SF.net SVN: geany: [1664] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Wed Jul 4 17:42:04 UTC 2007


Revision: 1664
          http://svn.sourceforge.net/geany/?rev=1664&view=rev
Author:   eht16
Date:     2007-07-04 10:42:01 -0700 (Wed, 04 Jul 2007)

Log Message:
-----------
Use a unique mutex name on Windows to be able to load multiple instances like on non-Windows systems.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/socket.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-07-04 17:08:53 UTC (rev 1663)
+++ trunk/ChangeLog	2007-07-04 17:42:01 UTC (rev 1664)
@@ -7,6 +7,8 @@
    src/document.h, src/editor.c, src/project.c, src/search.c,
    src/utils.c, src/win32.c, src/win32.h:
    Fix focus problem when using the Find dialog.
+ * src/socket.c: Use a unique mutex name on Windows to be able to load
+                 multiple instances like on non-Windows systems.
 
 
 2007-07-04  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/src/socket.c
===================================================================
--- trunk/src/socket.c	2007-07-04 17:08:53 UTC (rev 1663)
+++ trunk/src/socket.c	2007-07-04 17:42:01 UTC (rev 1664)
@@ -157,9 +157,13 @@
 
 #ifdef G_OS_WIN32
 	HANDLE hmutex;
+	// we need a mutex name which is unique for the used configuration dir,
+	// but we can't use the whole path, so build a hash on the configdir and use it
+	gchar *mutex_name = g_strdup_printf("Geany%d", g_str_hash(app->configdir));
 
 	socket_init_win32();
-	hmutex = CreateMutexA(NULL, FALSE, "Geany");
+	hmutex = CreateMutexA(NULL, FALSE, mutex_name);
+	g_free(mutex_name);
 	if (! hmutex)
 	{
 		geany_debug("cannot create Mutex\n");


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list