/* Rate limiting change events */
GHashTable *rate_limiter;
- guint pending_file_change_id;
+ GSource *pending_file_change_source;
GSList *pending_file_changes; /* FileChange */
GSource *timeout;
monitor = G_FILE_MONITOR (object);
priv = monitor->priv;
- if (priv->pending_file_change_id)
+ if (priv->pending_file_change_source)
{
- g_source_remove (priv->pending_file_change_id);
- priv->pending_file_change_id = 0;
+ g_source_destroy (priv->pending_file_change_source);
+ g_source_unref (priv->pending_file_change_source);
+ priv->pending_file_change_source = NULL;
}
g_slist_foreach (priv->pending_file_changes, (GFunc) file_change_free, NULL);
g_slist_free (priv->pending_file_changes);
pending = g_slist_reverse (monitor->priv->pending_file_changes);
monitor->priv->pending_file_changes = NULL;
- monitor->priv->pending_file_change_id = 0;
+ if (monitor->priv->pending_file_change_source)
+ {
+ g_source_unref (monitor->priv->pending_file_change_source);
+ monitor->priv->pending_file_change_source = NULL;
+ }
g_object_ref (monitor);
for (iter = pending; iter; iter = iter->next)
change->other_file = NULL;
change->event_type = event_type;
- if (!priv->pending_file_change_id)
+ if (!priv->pending_file_change_source)
{
source = g_idle_source_new ();
+ priv->pending_file_change_source = source;
g_source_set_priority (source, 0);
- /* We don't ref here - instead dispose will free any
+ /* We don't ref monitor here - instead dispose will free any
* pending idles.
*/
g_source_set_callback (source, emit_cb, monitor, NULL);
- priv->pending_file_change_id = g_source_attach (source, NULL);
- g_source_unref (source);
+ g_source_attach (source, NULL);
}
/* We reverse this in the processor */
priv->pending_file_changes = g_slist_prepend (priv->pending_file_changes, change);
GCancellable *cancellable;
int error_fd;
GIOChannel *error_channel;
- guint error_channel_source_id;
+ GSource *error_channel_source;
GString *error_string;
gchar **argv;
} UnmountEjectOp;
g_simple_async_result_complete (simple);
g_object_unref (simple);
- g_source_remove (data->error_channel_source_id);
+ if (data->error_channel_source)
+ {
+ g_source_destroy (data->error_channel_source);
+ g_source_unref (data->error_channel_source);
+ }
g_io_channel_unref (data->error_channel);
g_string_free (data->error_string, TRUE);
g_strfreev (data->argv);
g_string_append (data->error_string, error->message);
g_error_free (error);
+
+ if (data->error_channel_source)
+ {
+ g_source_unref (data->error_channel_source);
+ data->error_channel_source = NULL;
+ }
return FALSE;
}
{
UnmountEjectOp *data = (UnmountEjectOp *) user_data;
GPid child_pid;
+ GSource *child_watch;
GError *error = NULL;
if (!g_spawn_async_with_pipes (NULL, /* working dir */
if (error != NULL)
goto handle_error;
- data->error_channel_source_id = g_io_add_watch (data->error_channel, G_IO_IN, eject_unmount_read_error, data);
- g_child_watch_add (child_pid, eject_unmount_cb, data);
+ data->error_channel_source = g_io_create_watch (data->error_channel, G_IO_IN);
+ g_source_set_callback (data->error_channel_source,
+ (GSourceFunc) eject_unmount_read_error, data, NULL);
+ g_source_attach (data->error_channel_source, NULL);
+
+ child_watch = g_child_watch_source_new (child_pid);
+ g_source_set_callback (child_watch, (GSourceFunc) eject_unmount_cb, data, NULL);
+ g_source_attach (child_watch, NULL);
+ g_source_unref (child_watch);
handle_error:
if (error != NULL) {
GCancellable *cancellable;
int error_fd;
GIOChannel *error_channel;
- guint error_channel_source_id;
+ GSource *error_channel_source;
GString *error_string;
} EjectMountOp;
g_simple_async_result_complete (simple);
g_object_unref (simple);
- g_source_remove (data->error_channel_source_id);
+ if (data->error_channel_source)
+ {
+ g_source_destroy (data->error_channel_source);
+ g_source_unref (data->error_channel_source);
+ }
g_io_channel_unref (data->error_channel);
g_string_free (data->error_string, TRUE);
close (data->error_fd);
g_string_append (data->error_string, error->message);
g_error_free (error);
+
+ if (data->error_channel_source)
+ {
+ g_source_unref (data->error_channel_source);
+ data->error_channel_source = NULL;
+ }
return FALSE;
}
GUnixVolume *unix_volume = G_UNIX_VOLUME (volume);
EjectMountOp *data;
GPid child_pid;
+ GSource *child_watch;
GError *error;
data = g_new0 (EjectMountOp, 1);
if (error != NULL)
goto handle_error;
- data->error_channel_source_id = g_io_add_watch (data->error_channel, G_IO_IN, eject_mount_read_error, data);
- g_child_watch_add (child_pid, eject_mount_cb, data);
+ data->error_channel_source = g_io_create_watch (data->error_channel, G_IO_IN);
+ g_source_set_callback (data->error_channel_source,
+ (GSourceFunc) eject_mount_read_error, data, NULL);
+ g_source_attach (data->error_channel_source, NULL);
+
+ child_watch = g_child_watch_source_new (child_pid);
+ g_source_set_callback (child_watch, (GSourceFunc) eject_mount_cb, data, NULL);
+ g_source_attach (child_watch, NULL);
+ g_source_unref (child_watch);
handle_error:
if (error != NULL) {
HANDLE *event;
GSimpleAsyncResult *async_result;
gboolean complete;
- guint cancelled_idle;
+ GSource *cancelled_idle;
union {
struct {
/* Clean up cancellation-related stuff first */
if (req->cancelled_idle)
{
- g_source_remove (req->cancelled_idle);
- req->cancelled_idle = 0;
+ g_source_destroy (req->cancelled_idle);
+ g_source_unref (req->cancelled_idle);
+ req->cancelled_idle = NULL;
}
if (req->cancellable)
{
GWin32ResolverRequest *req = user_data;
GError *error = NULL;
- req->cancelled_idle = 0;
+ g_source_unref (req->cancelled_idle);
+ req->cancelled_idle = NULL;
g_cancellable_set_error_if_cancelled (req->cancellable, &error);
g_simple_async_result_set_from_error (req->async_result, error);
/* We need to wait until main-loop-time to actually complete the
* result; we don't use _complete_in_idle() here because we need to
- * keep track of the source id.
+ * keep track of the source so we can potentially cancel it before
+ * it runs.
*/
- req->cancelled_idle = g_idle_add (request_cancelled_idle, req);
+ req->cancelled_idle = g_idle_source_new ();
+ g_source_set_callback (req->cancelled_idle,
+ (GSourceFunc)request_cancelled_idle, req, NULL);
+ g_source_attach (req->cancelled_idle, NULL);
}
static DWORD WINAPI
exit 0
fi
-SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assertion_message\|\<g_warn_message\|\<g_atomic\|\<g_bit_\|\<g_boxed\|\<g_build_filename\|\<g_byte_array\|\<g_checksum\|\<g_child_watch\|\<g_clear_error\|\<g_convert\|\<g_dir_\|\<g_enum_\|\<g_error_\|\<g_prefix_error\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_file_read_link\|\<g_filename_\|\<g_find_program_in_path\|\<g_flags_\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_setenv\|\<g_hash_table_\|\<g_hostname_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_add_watch\|\<g_io_channel_\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_\|\<g_main_loop_\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_poll\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_random_int_range\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_'
+SKIP='\<g_access\|\<g_array_\|\<g_ascii\|\<g_list_\|\<g_assertion_message\|\<g_warn_message\|\<g_atomic\|\<g_bit_\|\<g_boxed\|\<g_build_filename\|\<g_byte_array\|\<g_checksum\|\<g_child_watch\|\<g_clear_error\|\<g_convert\|\<g_dir_\|\<g_enum_\|\<g_error_\|\<g_prefix_error\|\<g_file_error_quark\|\<g_file_get_contents\|\<g_file_set_contents\|\<g_file_test\|\<g_file_read_link\|\<g_filename_\|\<g_find_program_in_path\|\<g_flags_\|\<g_free\|\<g_get_\|\<g_getenv\|\<g_setenv\|\<g_hash_table_\|\<g_hostname_\|\<g_idle_\|\<g_intern_static_string\|\<g_io_add_watch\|\<g_io_channel_\|\<g_io_create_watch\|\<g_key_file_\|\<g_listenv\|\<g_locale_to_utf8\|\<g_log\|\<g_main_context_\|\<g_main_loop_\|\<g_malloc\|\<g_markup_\|\<g_mkdir_\|\<g_mkstemp\|\<g_module_\|\<g_object_\|\<g_once_\|\<g_param_spec_\|\<g_path_\|\<g_poll\|\<g_printerr\|\<g_propagate_error\|\<g_ptr_array_\|\<g_qsort_\|\<g_quark_\|\<g_queue_\|\<g_random_int_range\|\<g_realloc\|\<g_return_if_fail\|\<g_set_error\|\<g_shell_\|\<g_signal_\|\<g_slice_\|\<g_slist_\|\<g_snprintf\|\<g_source_\|\<g_spawn_\|\<g_static_\|\<g_str\|\<g_thread_pool_\|\<g_time_val_add\|\<g_timeout_\|\<g_type_\|\<g_unlink\|\<g_uri_\|\<g_utf8_\|\<g_value_'
for so in .libs/lib*.so; do
echo Checking $so for local PLT entries