summaryrefslogtreecommitdiff
path: root/plugins/Db3x_mmap/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/Db3x_mmap/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/Db3x_mmap/dbsettings.cpp')
-rw-r--r--plugins/Db3x_mmap/dbsettings.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/plugins/Db3x_mmap/dbsettings.cpp b/plugins/Db3x_mmap/dbsettings.cpp
index 7f7687ab4c..c569357567 100644
--- a/plugins/Db3x_mmap/dbsettings.cpp
+++ b/plugins/Db3x_mmap/dbsettings.cpp
@@ -975,6 +975,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);
@@ -987,7 +994,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;