diff options
author | hristoterezov <hristo@jitsi.org> | 2014-05-13 19:40:02 +0300 |
---|---|---|
committer | hristoterezov <hristo@jitsi.org> | 2014-05-13 19:40:02 +0300 |
commit | 25bdcbadcfcbe5f877215cbf7fcf397be2fc6746 (patch) | |
tree | 3f3f7118f62f0989ed069908da420da7035f9ec3 /src/native | |
parent | c5a5a702c8103c449f3bcc12d2578d4bea7dd08f (diff) | |
download | jitsi-25bdcbadcfcbe5f877215cbf7fcf397be2fc6746.zip jitsi-25bdcbadcfcbe5f877215cbf7fcf397be2fc6746.tar.gz jitsi-25bdcbadcfcbe5f877215cbf7fcf397be2fc6746.tar.bz2 |
Fixes the issue with hanging JVM or Jitsi crashes when second instance of
Jitsi on windows is started.
Diffstat (limited to 'src/native')
-rw-r--r-- | src/native/addrbook/msoutlook/Logger.cxx | 8 | ||||
-rw-r--r-- | src/native/addrbook/msoutlook/MsOutlookAddrBookContactSourceService.cxx | 24 |
2 files changed, 31 insertions, 1 deletions
diff --git a/src/native/addrbook/msoutlook/Logger.cxx b/src/native/addrbook/msoutlook/Logger.cxx index c2f951d..7e7f2fe 100644 --- a/src/native/addrbook/msoutlook/Logger.cxx +++ b/src/native/addrbook/msoutlook/Logger.cxx @@ -26,6 +26,12 @@ Logger::Logger(const char* pLogFile, const char* pLogPath, int pLogLevel) memcpy(logPath, pLogPath, strlen(pLogPath) + 1);
if(pLogFile != NULL && strlen(pLogFile) != 0)
{
+// This code enables different log files for every instance of the application.
+// char *dateString = (char*)malloc(LOGGER_DATE_STRING_LENGTH*sizeof(char));
+// getCurrentTimeString(dateString);
+// logFile = (char*)malloc((strlen(pLogPath) + strlen(pLogFile) + strlen(dateString) + 1)*sizeof(char));
+// sprintf(logFile, "%s%s%s", pLogPath, dateString, pLogFile);
+// free(dateString);
logFile = (char*)malloc((strlen(pLogPath) + strlen(pLogFile) + 1)*sizeof(char));
sprintf(logFile, "%s%s", pLogPath, pLogFile);
file = fopen(logFile, "w");
@@ -73,7 +79,7 @@ void Logger::getCurrentTimeString(char* dateString) {
SYSTEMTIME systemTime;
GetSystemTime(&systemTime);
- sprintf(dateString,"[%u-%02u-%02u %02u:%02u:%02u.%u]",
+ sprintf(dateString,"%u-%02u-%02u-%02u-%02u-%02u.%u",
systemTime.wYear,
systemTime.wMonth,
systemTime.wDay,
diff --git a/src/native/addrbook/msoutlook/MsOutlookAddrBookContactSourceService.cxx b/src/native/addrbook/msoutlook/MsOutlookAddrBookContactSourceService.cxx index e65f02a..d6166c8 100644 --- a/src/native/addrbook/msoutlook/MsOutlookAddrBookContactSourceService.cxx +++ b/src/native/addrbook/msoutlook/MsOutlookAddrBookContactSourceService.cxx @@ -8,6 +8,8 @@ #include "MsOutlookAddrBookContactSourceService.h" #include "com/ComClient.h" +#include "com/MsOutlookAddrBookServerClassFactory.h" +#include "com/MsOutlookAddrBookClientClassFactory.h" #include "MAPINotification.h" #include "MAPISession.h" #include "MAPIBitness.h" @@ -436,6 +438,28 @@ HRESULT MsOutlookAddrBookContactSourceService_MAPIInitializeCOMServer(void) MAPISession_lock(); MsOutlookUtils_log("Init com server."); + + IMsOutlookAddrBookServer * ComClient_iServer = NULL; + if((hr = CoInitializeEx(NULL, COINIT_MULTITHREADED)) == S_OK + || hr == S_FALSE) + { + if((hr = CoCreateInstance( + CLSID_MsOutlookAddrBookServer, + NULL, + CLSCTX_LOCAL_SERVER, + IID_IMsOutlookAddrBookServer, + (void**) &ComClient_iServer)) == S_OK) + { + MsOutlookUtils_log("COM Server already started"); + if(ComClient_iServer) + { + ComClient_iServer->Release(); + ComClient_iServer = NULL; + } + return E_FAIL; + } + } + // Start COM service if((hr = MsOutlookAddrBookContactSourceService_startComServer()) == S_OK) { |