Quellcode durchsuchen

Memory leak in progress window in command-line run

Source commit: daef43d38702def4b153dc5cbad54e8243931d77
Martin Prikryl vor 10 Jahren
Ursprung
Commit
e73cfb66da
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4 0
      source/forms/Progress.cpp

+ 4 - 0
source/forms/Progress.cpp

@@ -434,6 +434,10 @@ void __fastcall TProgressForm::FormShow(TObject * /*Sender*/)
   {
     UpdateControls();
   }
+  // HACK: In command-line run (/upload), FormShow gets called twice,
+  // leading to duplicate hook and memory leak. Make sure we unhook, just in case.
+  // Calling unhook without hooking first is noop.
+  UnhookFormActivation(this);
   HookFormActivation(this);
 }
 //---------------------------------------------------------------------------