From 8a57021372287690973dc13cbcd9dd41946cc6f9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Jun 2019 13:19:22 +0300 Subject: Plugin Updater: fix for a crash if the update dialog is closed while download isn't finished yet --- plugins/PluginUpdater/src/DlgUpdate.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins/PluginUpdater/src') 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 &todo = *(OBJLIST *)GetWindowLongPtr(hDlg, GWLP_USERDATA); - if (todo.getCount() == 0) { + OBJLIST &fileList = *(OBJLIST *)GetWindowLongPtr(hDlg, GWLP_USERDATA); + if (fileList.getCount() == 0) { return; } + // make a local copy not to crash if a window was closed + OBJLIST todo(fileList); + // 1) If we need to escalate priviledges, launch a stub if (!PrepareEscalation()) { PostMessage(hDlg, WM_CLOSE, 0, 0); -- cgit v1.2.3