Sync with trunk head (part 1 of 2)
[reactos.git] / base / applications / notepad / settings.c
index 862e4fb..9a68c8b 100644 (file)
@@ -147,16 +147,16 @@ void LoadSettings(void)
                if (dwPointSize != 0)
                        Globals.lfFont.lfHeight = HeightFromPointSize(dwPointSize);
 
-               hFont = CreateFontIndirect(&Globals.lfFont);
-               if (hFont)
-               {
-                       if (Globals.hFont)
-                               DeleteObject(Globals.hFont);
-                       Globals.hFont = hFont;
-               }
-
                RegCloseKey(hKey);
        }
+
+       hFont = CreateFontIndirect(&Globals.lfFont);
+       if (hFont)
+       {
+               if (Globals.hFont)
+                       DeleteObject(Globals.hFont);
+               Globals.hFont = hFont;
+       }
 }
 
 static BOOL SaveDword(HKEY hKey, LPCTSTR pszValueNameT, DWORD dwValue)