summaryrefslogtreecommitdiff
path: root/src/modules/chat/chat_svc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-19 09:47:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-19 09:47:25 +0000
commit30bb4f6786fc9ab808bc3bed8a143b524f07387b (patch)
treeeebb6d6e19708d748dd60a84268dfc493fb393a1 /src/modules/chat/chat_svc.cpp
parent4d6a4771d90af0056e15ed14c3655b19023359ca (diff)
fix against loosing chat sessions during chat plugin's unload
git-svn-id: http://svn.miranda-ng.org/main/trunk@7746 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat/chat_svc.cpp')
-rw-r--r--src/modules/chat/chat_svc.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index c0ab9d8116..49fa9cebc8 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -27,7 +27,7 @@ INT_PTR SvcGetChatManager(WPARAM, LPARAM);
#include "chat.h"
HGENMENU hJoinMenuItem, hLeaveMenuItem;
-CRITICAL_SECTION cs;
+CRITICAL_SECTION cs;
static HANDLE
hServiceRegister = NULL,
@@ -571,19 +571,8 @@ static int ModulesLoaded(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// Service creation
-static bool bInited = false;
-
int LoadChatModule(void)
{
- CreateServiceFunction("GChat/GetInterface", SvcGetChatManager);
- return 0;
-}
-
-void InitChatModule(void)
-{
- if (bInited)
- return;
-
InitializeCriticalSection(&cs);
HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
@@ -601,20 +590,18 @@ void InitChatModule(void)
CreateServiceFunction("GChat/PrebuildMenuEvent", PrebuildContactMenuSvc);
CreateServiceFunction("GChat/JoinChat", JoinChat);
CreateServiceFunction("GChat/LeaveChat", LeaveChat);
+ CreateServiceFunction("GChat/GetInterface", SvcGetChatManager);
ci.hSendEvent = CreateHookableEvent(ME_GC_EVENT);
ci.hBuildMenuEvent = CreateHookableEvent(ME_GC_BUILDMENU);
HookEvent(ME_FONT_RELOAD, FontsChanged);
HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
- bInited = true;
+ return 0;
}
void UnloadChatModule(void)
{
- if (!bInited)
- return;
-
OptionsUnInit();
DeleteCriticalSection(&cs);