summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mmap_SA/dbsettings.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-28 15:05:21 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-28 15:05:21 +0000
commita1b54aadf426b4ce2ce3c900a889f53f1eec6bce (patch)
tree44fa2c5f6ecff873ccf332dd3bf0fd4ccff2ebe5 /plugins/Dbx_mmap_SA/dbsettings.cpp
parentb91e3f8d37797d53b115dd5dd862953a2c595e5f (diff)
patch for crash on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@668 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
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;