From 7558d40a73d0e8d986e2e9611a55a3b768edcb0a Mon Sep 17 00:00:00 2001 From: Shaun McCance Date: Fri, 24 Jun 2011 15:13:35 -0400 Subject: Fixed search crash on 64-bit, didn't #include header If you don't #include the header, the default return type is int, which truncates the pointer on 64-bit systems, which crashes. --- libyelp/yelp-storage.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libyelp/yelp-storage.c') diff --git a/libyelp/yelp-storage.c b/libyelp/yelp-storage.c index 97a1786b..e369f42b 100644 --- a/libyelp/yelp-storage.c +++ b/libyelp/yelp-storage.c @@ -42,8 +42,11 @@ yelp_storage_set_default (YelpStorage *storage) YelpStorage * yelp_storage_get_default (void) { + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; + g_static_mutex_lock (&mutex); if (default_storage == NULL) default_storage = yelp_sqlite_storage_new (":memory:"); + g_static_mutex_unlock (&mutex); return default_storage; } -- cgit v1.2.1