Преглед изворни кода

Bug fix: Failure on exit (variation on high DPI)

When closing after transfer on command-line run (/update) on > 100% zoom

Source commit: fdc1402caebba6106bfef6c6c3a25cb43f805fd5
Martin Prikryl пре 9 година
родитељ
комит
4b0946912d
1 измењених фајлова са 15 додато и 8 уклоњено
  1. 15 8
      source/forms/Glyphs.cpp

+ 15 - 8
source/forms/Glyphs.cpp

@@ -44,15 +44,22 @@ __fastcall TGlyphsModule::TGlyphsModule(TComponent* Owner)
 
   if (ScaledModule != NULL)
   {
-    CopyDataModule(this, ScaledModule);
+    try
+    {
+      CopyDataModule(this, ScaledModule);
 
-    // Not all these are accessed by field name, but we copy all for consistency
-    ExplorerImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(ExplorerImages->Name)));
-    SessionImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(SessionImages->Name)));
-    QueueImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(QueueImages->Name)));
-    LogImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(LogImages->Name)));
-    ButtonImages = DebugNotNull(dynamic_cast<TImageList *>(FindComponent(ButtonImages->Name)));
-    DialogImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(DialogImages->Name)));
+      // Not all these are accessed by field name, but we copy all for consistency
+      ExplorerImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(ExplorerImages->Name)));
+      SessionImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(SessionImages->Name)));
+      QueueImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(QueueImages->Name)));
+      LogImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(LogImages->Name)));
+      ButtonImages = DebugNotNull(dynamic_cast<TImageList *>(FindComponent(ButtonImages->Name)));
+      DialogImages = DebugNotNull(dynamic_cast<TPngImageList *>(FindComponent(DialogImages->Name)));
+    }
+    __finally
+    {
+      delete ScaledModule;
+    }
   }
 }
 //---------------------------------------------------------------------------