diff options
author | Shaun McCance <shaunm@gnome.org> | 2011-06-24 15:13:35 -0400 |
---|---|---|
committer | Shaun McCance <shaunm@gnome.org> | 2011-06-24 15:13:35 -0400 |
commit | f13b97e5d25d5eee69a5d57ccb38bc90ea6c305e (patch) | |
tree | 4f9b989f24aa5692b230b626ff29995ff3033995 | |
parent | 6949064685940d5fdbd7b9abd0d5b63439424a66 (diff) | |
download | yelp-f13b97e5d25d5eee69a5d57ccb38bc90ea6c305e.tar.gz |
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.
-rw-r--r-- | libyelp/yelp-docbook-document.c | 1 | ||||
-rw-r--r-- | libyelp/yelp-mallard-document.c | 1 | ||||
-rw-r--r-- | libyelp/yelp-storage.c | 3 |
3 files changed, 5 insertions, 0 deletions
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c index 7b8dc68a..a8889bad 100644 --- a/libyelp/yelp-docbook-document.c +++ b/libyelp/yelp-docbook-document.c @@ -34,6 +34,7 @@ #include "yelp-docbook-document.h" #include "yelp-error.h" #include "yelp-settings.h" +#include "yelp-storage.h" #include "yelp-transform.h" #include "yelp-debug.h" diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c index 2c62a7f1..5ce5f171 100644 --- a/libyelp/yelp-mallard-document.c +++ b/libyelp/yelp-mallard-document.c @@ -34,6 +34,7 @@ #include "yelp-error.h" #include "yelp-mallard-document.h" #include "yelp-settings.h" +#include "yelp-storage.h" #include "yelp-transform.h" #include "yelp-debug.h" 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; } |