summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_core/miranda.cpp1
-rw-r--r--src/mir_core/modules.cpp43
-rw-r--r--src/mir_core/utils.cpp41
-rw-r--r--src/modules/skin/hotkeys.cpp5
4 files changed, 47 insertions, 43 deletions
diff --git a/src/mir_core/miranda.cpp b/src/mir_core/miranda.cpp
index b059e11cb7..61b14ced06 100644
--- a/src/mir_core/miranda.cpp
+++ b/src/mir_core/miranda.cpp
@@ -79,6 +79,7 @@ MIR_CORE_DLL(void) UnloadCoreModule(void)
{
DestroyWindow(hAPCWindow);
CloseHandle(hStackMutex);
+ CloseHandle(hThreadQueueEmpty);
DestroyModularEngine();
UnloadLangPackModule();
diff --git a/src/mir_core/modules.cpp b/src/mir_core/modules.cpp
index 67cf6ce267..2ff0fabe06 100644
--- a/src/mir_core/modules.cpp
+++ b/src/mir_core/modules.cpp
@@ -575,6 +575,47 @@ static void DestroyServices()
///////////////////////////////////////////////////////////////////////////////
+static int sttComparePlugins(const HINSTANCE__* p1, const HINSTANCE__* p2)
+{
+ if (p1 == p2)
+ return 0;
+
+ return (p1 < p2) ? -1 : 1;
+}
+
+LIST<HINSTANCE__> pluginListAddr(10, sttComparePlugins);
+
+MIR_CORE_DLL(void) RegisterModule(HINSTANCE hInst)
+{
+ pluginListAddr.insert(hInst);
+}
+
+MIR_CORE_DLL(void) UnregisterModule(HINSTANCE hInst)
+{
+ pluginListAddr.remove(hInst);
+}
+
+MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr)
+{
+ if (pluginListAddr.getCount() == 0)
+ return NULL;
+
+ int idx;
+ List_GetIndex((SortedList*)&pluginListAddr, codePtr, &idx);
+ if (idx > 0)
+ idx--;
+
+ HINSTANCE result = pluginListAddr[idx];
+ if (result < hInst && codePtr > hInst)
+ result = hInst;
+ else if (idx == 0 && codePtr < (void*)result)
+ result = NULL;
+
+ return result;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+
int InitialiseModularEngine(void)
{
InitializeCriticalSection(&csHooks);
@@ -597,5 +638,7 @@ void DestroyModularEngine(void)
services.destroy();
DeleteCriticalSection(&csServices);
+ pluginListAddr.destroy();
+
CloseHandle(hMainThread);
}
diff --git a/src/mir_core/utils.cpp b/src/mir_core/utils.cpp
index 12aad9d8a9..584519f3f0 100644
--- a/src/mir_core/utils.cpp
+++ b/src/mir_core/utils.cpp
@@ -123,44 +123,3 @@ MIR_CORE_DLL(int) wildcmp(char * name, char * mask)
if (*mask != '?' && *mask != *name) name -= (size_t)(mask - last) - 1, mask = last;
}
}
-
-///////////////////////////////////////////////////////////////////////////////
-
-static int sttComparePlugins(const HINSTANCE__* p1, const HINSTANCE__* p2)
-{
- if (p1 == p2)
- return 0;
-
- return (p1 < p2) ? -1 : 1;
-}
-
-LIST<HINSTANCE__> pluginListAddr(10, sttComparePlugins);
-
-MIR_CORE_DLL(void) RegisterModule(HINSTANCE hInst)
-{
- pluginListAddr.insert(hInst);
-}
-
-MIR_CORE_DLL(void) UnregisterModule(HINSTANCE hInst)
-{
- pluginListAddr.remove(hInst);
-}
-
-MIR_CORE_DLL(HINSTANCE) GetInstByAddress(void* codePtr)
-{
- if (pluginListAddr.getCount() == 0)
- return NULL;
-
- int idx;
- List_GetIndex((SortedList*)&pluginListAddr, codePtr, &idx);
- if (idx > 0)
- idx--;
-
- HINSTANCE result = pluginListAddr[idx];
- if (result < hInst && codePtr > hInst)
- result = hInst;
- else if (idx == 0 && codePtr < (void*)result)
- result = NULL;
-
- return result;
-}
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index 05297f92b3..b72a3ad3e2 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -396,9 +396,10 @@ void UnloadSkinHotkeys(void)
DestroyHookableEvent(hEvChanged);
UnhookWindowsHookEx(hhkKeyboard);
- UnregisterHotkeys();
- DestroyWindow(g_hwndHotkeyHost);
+
for (int i=0; i < hotkeys.getCount(); i++)
FreeHotkey(hotkeys[i]);
hotkeys.destroy();
+
+ DestroyWindow(g_hwndHotkeyHost);
}