Author: abrander
Date: 2009-12-21 11:21:08 +0100 (Mon, 21 Dec 2009)
New Revision: 2832
Modified:
trunk/src/rs-library.c
Log:
Implemented the singleton pattern (tm) in rs_library_get_singleton().
Modified: trunk/src/rs-library.c
===================================================================
--- trunk/src/rs-library.c 2009-12-21 10:10:55 UTC (rev 2831)
+++ trunk/src/rs-library.c 2009-12-21 10:21:08 UTC (rev 2832)
@@ -137,7 +137,8 @@
static RSLibrary *singleton = NULL;
g_static_mutex_lock(&singleton_lock);
- singleton = g_object_new(RS_TYPE_LIBRARY, NULL);
+ if (!singleton)
+ singleton = g_object_new(RS_TYPE_LIBRARY, NULL);
g_static_mutex_unlock(&singleton_lock);
return singleton;
_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit