summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-04-13 11:42:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-04-13 11:42:13 +0300
commit9c6f173f42dff74fbdfd9db12756a3fb56cb95dc (patch)
treef541210a4ddf630732f20cff6099958874a02dae
parent564bb12e16997964fc2d92a6b5a15937894115fa (diff)
NewStory: fix for possible crash on exit
-rw-r--r--plugins/NewStory/src/fonts.cpp2
-rw-r--r--plugins/NewStory/src/main.cpp9
2 files changed, 9 insertions, 2 deletions
diff --git a/plugins/NewStory/src/fonts.cpp b/plugins/NewStory/src/fonts.cpp
index eb389738aa..4c668411f5 100644
--- a/plugins/NewStory/src/fonts.cpp
+++ b/plugins/NewStory/src/fonts.cpp
@@ -43,7 +43,7 @@ int evtFontsChanged(WPARAM, LPARAM)
it.hfnt = CreateFontIndirectA(&it.lf);
}
- // WindowList_Broadcast(hNewstoryWindows, UM_REDRAWLISTH, 0, 0);
+ WindowList_Broadcast(hNewstoryWindows, UM_REDRAWLISTH, 0, 0);
return 0;
}
diff --git a/plugins/NewStory/src/main.cpp b/plugins/NewStory/src/main.cpp
index c0612b7629..d32f484bac 100644
--- a/plugins/NewStory/src/main.cpp
+++ b/plugins/NewStory/src/main.cpp
@@ -69,7 +69,7 @@ static IconItem icons[] =
{ LPGEN("Help"), "varhelp", ICO_VARHELP }
};
-int evtModulesLoaded(WPARAM, LPARAM)
+static int evtModulesLoaded(WPARAM, LPARAM)
{
InitFonts();
InitNewstoryControl();
@@ -94,6 +94,12 @@ int evtModulesLoaded(WPARAM, LPARAM)
return 0;
}
+static int evtPreShutdown(WPARAM, LPARAM)
+{
+ WindowList_Broadcast(hNewstoryWindows, WM_CLOSE, 0, 0);
+ return 0;
+}
+
int CMPlugin::Load()
{
g_plugin.registerIcon(MODULETITLE, icons);
@@ -105,6 +111,7 @@ int CMPlugin::Load()
HookEvent(ME_OPT_INITIALISE, OptionsInitialize);
HookEvent(ME_SYSTEM_MODULESLOADED, evtModulesLoaded);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, evtPreShutdown);
return 0;
}