Re: [Licq-devel] Current version hangs on OS X 10.6

Erik Johansson <[email protected]> Sun, 10 Jan 2010 18:24:15 +0100
Newsgroups gmane.network.licq.devel
Message-ID <[email protected]>
Please try the attached patch and see if it helps. With the patch
qt4-gui will run in the main thread, so quitting might or might not
work as expected...

// Erik

-- 
Erik Johansson
Home Page: http://ejohansson.se/
PGP Key: http://ejohansson.se/erik.asc
start-qt-gui-in-main-thread.patch (application/octet-stream, 1.1 KB)
Index: licq/src/plugins/plugin.cpp
===================================================================
--- licq/src/plugins/plugin.cpp	(revision 7069)
+++ licq/src/plugins/plugin.cpp	(working copy)
@@ -50,7 +50,13 @@
 
 void Plugin::startThread(CICQDaemon* daemon)
 {
-  ::pthread_create(&myThread, NULL, myMainThreadEntryPoint, daemon);
+  if (std::string("Qt4 GUI") == getName())
+  {
+    myThread = ::pthread_self();
+    myMainThreadEntryPoint(daemon);
+  }
+  else
+    ::pthread_create(&myThread, NULL, myMainThreadEntryPoint, daemon);
 }
 
 int Plugin::joinThread()
Index: licq/src/plugins/pluginmanager.cpp
===================================================================
--- licq/src/plugins/pluginmanager.cpp	(revision 7069)
+++ licq/src/plugins/pluginmanager.cpp	(working copy)
@@ -161,8 +161,8 @@
 
 void PluginManager::startAllPlugins()
 {
-  MutexLocker generalLocker(myGeneralPluginsMutex);
-  MutexLocker protocolLocker(myProtocolPluginsMutex);
+  //MutexLocker generalLocker(myGeneralPluginsMutex);
+  //MutexLocker protocolLocker(myProtocolPluginsMutex);
 
   BOOST_FOREACH(GeneralPlugin::Ptr plugin, myGeneralPlugins)
   {