diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-28 15:05:21 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-28 15:05:21 +0000 |
commit | a1b54aadf426b4ce2ce3c900a889f53f1eec6bce (patch) | |
tree | 44fa2c5f6ecff873ccf332dd3bf0fd4ccff2ebe5 /plugins/Db3x/dbsettings.cpp | |
parent | b91e3f8d37797d53b115dd5dd862953a2c595e5f (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/dbsettings.cpp')
-rw-r--r-- | plugins/Db3x/dbsettings.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Db3x/dbsettings.cpp b/plugins/Db3x/dbsettings.cpp index ad7e470650..c8eb18c208 100644 --- a/plugins/Db3x/dbsettings.cpp +++ b/plugins/Db3x/dbsettings.cpp @@ -941,6 +941,13 @@ static int stringCompare2( DBCachedGlobalValue* p1, DBCachedGlobalValue* p2 ) return strcmp( p1->name, p2->name );
}
+static int OnPreShutdown(WPARAM, LPARAM)
+{
+ DestroyHookableEvent(hSettingChangeEvent);
+ hSettingChangeEvent = 0;
+ return 0;
+}
+
int InitSettings(void)
{
CreateServiceFunction(MS_DB_CONTACT_GETSETTING,GetContactSetting);
@@ -951,7 +958,9 @@ int InitSettings(void) CreateServiceFunction(MS_DB_CONTACT_DELETESETTING,DeleteContactSetting);
CreateServiceFunction(MS_DB_CONTACT_ENUMSETTINGS,EnumContactSettings);
CreateServiceFunction(MS_DB_SETSETTINGRESIDENT,SetSettingResident);
- hSettingChangeEvent=CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
+
+ hSettingChangeEvent = CreateHookableEvent(ME_DB_CONTACT_SETTINGCHANGED);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
mirCp = CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 );
|