[SYSSETUP] Delete the created fonts when needed.
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Sun, 20 May 2018 18:35:56 +0000 (20:35 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 8 Oct 2018 19:16:58 +0000 (21:16 +0200)
dll/win32/syssetup/wizard.c

index aa26296..2eafef7 100644 (file)
@@ -2655,6 +2655,9 @@ InstallWizard(VOID)
         }
     }
 
         }
     }
 
+    DeleteObject(pSetupData->hBoldFont);
+    DeleteObject(pSetupData->hTitleFont);
+
     if (pSetupData->hUnattendedInf != INVALID_HANDLE_VALUE)
         SetupCloseInfFile(pSetupData->hUnattendedInf);
 
     if (pSetupData->hUnattendedInf != INVALID_HANDLE_VALUE)
         SetupCloseInfFile(pSetupData->hUnattendedInf);
 
@@ -2666,11 +2669,7 @@ done:
         FreeLibrary(hNetShell);
 
     if (pSetupData != NULL)
         FreeLibrary(hNetShell);
 
     if (pSetupData != NULL)
-    {
-        DeleteObject(pSetupData->hBoldFont);
-        DeleteObject(pSetupData->hTitleFont);
         HeapFree(GetProcessHeap(), 0, pSetupData);
         HeapFree(GetProcessHeap(), 0, pSetupData);
-    }
 
     LogItem(L"END_SECTION", L"InstallWizard");
 }
 
     LogItem(L"END_SECTION", L"InstallWizard");
 }