[darwinbuild-changes] [12] trunk/darwinxref/DBPlugin.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Oct 4 01:36:58 PDT 2006


Revision: 12
          http://trac.macosforge.org/projects/darwinbuild/changeset/12
Author:   kevin
Date:     2006-10-04 01:36:58 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
- allow multiple calls to load plugins

Modified Paths:
--------------
    trunk/darwinxref/DBPlugin.c

Modified: trunk/darwinxref/DBPlugin.c
===================================================================
--- trunk/darwinxref/DBPlugin.c	2005-06-13 21:37:30 UTC (rev 11)
+++ trunk/darwinxref/DBPlugin.c	2006-10-04 08:36:58 UTC (rev 12)
@@ -49,8 +49,10 @@
 static CFMutableDictionaryRef plugins;
 
 int load_plugins(const char* plugin_path) {
-	plugins = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &cfDictionaryPluginValueCallBacks);
-	if (!plugins) return -1;
+	if (plugins == NULL) {
+		plugins = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &cfDictionaryPluginValueCallBacks);
+	}
+	if (plugins == NULL) return -1;
 	
 	char fullpath[PATH_MAX];
 	realpath(plugin_path, fullpath);

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20061004/7c2144a0/attachment.html


More information about the darwinbuild-changes mailing list