TYPE_LOCK();
+ camel_type_init(); /* has a static boolean itself */
+
/* Have to check creation, it might've happened in another thread before we got here */
klass = g_hash_table_lookup(type_table, name);
if (klass != NULL) {
{
GList *list = NULL;
- g_assert(provider_table);
+
+ /* provider_table can be NULL, so initialize it */
+ if (G_UNLIKELY (provider_table == NULL))
+ camel_provider_init ();
+
+ g_return_val_if_fail (provider_table != NULL, NULL);
LOCK();
char *protocol;
size_t len;
- g_return_val_if_fail(url_string != NULL, NULL);
- g_assert(provider_table);
+ g_return_val_if_fail (url_string != NULL, NULL);
+ g_return_val_if_fail (provider_table != NULL, NULL);
len = strcspn(url_string, ":");
protocol = g_alloca(len+1);