summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/dbsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Dbx_mmap_SA/dbsettings.cpp')
-rw-r--r--plugins/Dbx_mmap_SA/dbsettings.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/Dbx_mmap_SA/dbsettings.cpp b/plugins/Dbx_mmap_SA/dbsettings.cpp
index d8ad0e643e..fd839ab258 100644
--- a/plugins/Dbx_mmap_SA/dbsettings.cpp
+++ b/plugins/Dbx_mmap_SA/dbsettings.cpp
@@ -1132,6 +1132,13 @@ static int stringCompare2( char* p1, char* p2 )
return strcmp( p1, p2);
}
+static int OnPreShutdown(WPARAM, LPARAM)
+{
+ DestroyHookableEvent(hSettingChangeEvent);
+ hSettingChangeEvent = 0;
+ return 0;
+}
+
int InitSettings(void)
{
CreateServiceFunction(MS_DB_CONTACT_GETSETTING, GetContactSetting);
@@ -1144,7 +1151,8 @@ int InitSettings(void)
CreateServiceFunction(MS_DB_SETSETTINGRESIDENT, SetSettingResident);
CreateServiceFunction("DB/ResidentSettings/Enum", EnumResidentSettings);
- hSettingChangeEvent=CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
+ hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
hCacheHeap = HeapCreate(0, 0, 0);
lSettings.sortFunc = (FSortFunc)stringCompare;