diff options
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 );
|