diff options
author | George Hazan <ghazan@miranda.im> | 2019-06-27 13:19:22 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-06-27 13:19:22 +0300 |
commit | 8a57021372287690973dc13cbcd9dd41946cc6f9 (patch) | |
tree | 6b3dce52a20e7d27b8ea71476ee1b415021d855b /plugins/PluginUpdater | |
parent | 718e96a95c5596fa6c7e21984cf8bdfb6d528e60 (diff) |
Plugin Updater: fix for a crash if the update dialog is closed while download isn't finished yet
Diffstat (limited to 'plugins/PluginUpdater')
-rw-r--r-- | plugins/PluginUpdater/src/DlgUpdate.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp index 28ab893c4b..a8d2d99eeb 100644 --- a/plugins/PluginUpdater/src/DlgUpdate.cpp +++ b/plugins/PluginUpdater/src/DlgUpdate.cpp @@ -46,11 +46,14 @@ static void ApplyUpdates(void *param) Thread_SetName("PluginUpdater: ApplyUpdates");
HWND hDlg = (HWND)param;
- OBJLIST<FILEINFO> &todo = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
- if (todo.getCount() == 0) {
+ OBJLIST<FILEINFO> &fileList = *(OBJLIST<FILEINFO> *)GetWindowLongPtr(hDlg, GWLP_USERDATA);
+ if (fileList.getCount() == 0) {
return;
}
+ // make a local copy not to crash if a window was closed
+ OBJLIST<FILEINFO> todo(fileList);
+
// 1) If we need to escalate priviledges, launch a stub
if (!PrepareEscalation()) {
PostMessage(hDlg, WM_CLOSE, 0, 0);
|