diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-18 07:53:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-18 07:53:00 +0000 |
commit | 69ee782255e915d282f17cf702eff574fb82e84a (patch) | |
tree | 9562efd6d62e45a11f04b386ab6b271874921480 /src/modules/chat/chat_svc.cpp | |
parent | 3becde66074e1c9693e9cb06d83badb2d859bdfc (diff) |
kernel chat module still to be loaded only by request
git-svn-id: http://svn.miranda-ng.org/main/trunk@7707 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat/chat_svc.cpp')
-rw-r--r-- | src/modules/chat/chat_svc.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp index b27525400e..bfb928ce11 100644 --- a/src/modules/chat/chat_svc.cpp +++ b/src/modules/chat/chat_svc.cpp @@ -557,8 +557,19 @@ 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);
@@ -576,18 +587,20 @@ int LoadChatModule(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);
- return 0;
+ bInited = true;
}
void UnloadChatModule(void)
{
+ if (!bInited)
+ return;
+
OptionsUnInit();
DeleteCriticalSection(&cs);
|