#define E_SETTINGS_DEFAULT_MEMO_LIST_KEY "default-memo-list"
#define E_SETTINGS_DEFAULT_TASK_LIST_KEY "default-task-list"
-/* This forces the GType to be registered in a way that
- * avoids a "statement with no effect" compiler warning.
- * FIXME Use g_type_ensure() once we require GLib 2.34. */
-#define REGISTER_TYPE(type) \
- (g_type_class_unref (g_type_class_ref (type)))
-
typedef struct _AsyncContext AsyncContext;
typedef struct _AuthContext AuthContext;
typedef struct _CreateContext CreateContext;
g_hash_table_remove_all (priv->sources);
if (priv->settings != NULL) {
+ g_signal_handlers_disconnect_by_data (priv->settings, object);
g_object_unref (priv->settings);
priv->settings = NULL;
}
registry->priv->thread_closure = closure;
- registry->priv->manager_thread = g_thread_new (NULL,
+ registry->priv->manager_thread = g_thread_new (
+ NULL,
source_registry_object_manager_thread,
closure);
return FALSE;
}
- /* The registry should now be populated with sources. */
- g_warn_if_fail (g_hash_table_size (registry->priv->sources) > 0);
+ /* The registry should now be populated with sources.
+ *
+ * XXX Actually, not necessarily if the registry service was
+ * just now activated. There may yet be a small window
+ * while the registry service starts up before it exports
+ * any sources, even built-in sources. This COULD create
+ * problems if any logic that depends on those built-in
+ * sources executes during this time window, but so far
+ * we haven't seen any cases of that.
+ *
+ * Attempts in the past to stop and wait for sources to
+ * show up have proven problematic. See for example:
+ * https://bugzilla.gnome.org/678378
+ *
+ * Leave the runtime check disabled for the moment.
+ * I have a feeling I'll be revisiting this again.
+ */
+ /*g_warn_if_fail (g_hash_table_size (registry->priv->sources) > 0);*/
/* The EDBusSourceManagerProxy is just another D-Bus interface
* that resides at the same object path. It's unrelated to the
/* XXX Work around http://bugzilla.gnome.org/show_bug.cgi?id=683519
* until GObject's type initialization deadlock issue is fixed.
* Apparently only the synchronous instantiation is affected. */
- REGISTER_TYPE (G_TYPE_DBUS_CONNECTION);
+ g_type_ensure (G_TYPE_DBUS_CONNECTION);
return g_initable_new (
E_TYPE_SOURCE_REGISTRY,
exit:
g_main_context_pop_thread_default (main_context);
+
+ /* Make sure the main_context doesn't have pending operations;
+ workarounds https://bugzilla.gnome.org/show_bug.cgi?id=690126 */
+ while (g_main_context_pending (main_context))
+ g_main_context_iteration (main_context, FALSE);
+
g_main_context_unref (main_context);
return success;
uid = E_SOURCE_BUILTIN_ADDRESS_BOOK_UID;
source = e_source_registry_ref_source (registry, uid);
- g_return_val_if_fail (source != NULL, NULL);
return source;
}
source = e_source_registry_ref_source (registry, uid);
g_free (uid);
- /* The built-in source is always present. */
+ /* The built-in source is present in normal EDS installations. */
if (source == NULL)
source = e_source_registry_ref_builtin_address_book (registry);
- g_return_val_if_fail (E_IS_SOURCE (source), NULL);
-
return source;
}
uid = E_SOURCE_BUILTIN_CALENDAR_UID;
source = e_source_registry_ref_source (registry, uid);
- g_return_val_if_fail (source != NULL, NULL);
return source;
}
source = e_source_registry_ref_source (registry, uid);
g_free (uid);
- /* The built-in source is always present. */
+ /* The built-in source is present in normal EDS installations. */
if (source == NULL)
source = e_source_registry_ref_builtin_calendar (registry);
- g_return_val_if_fail (E_IS_SOURCE (source), NULL);
-
return source;
}