aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-04-01 13:55:30 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-04-01 13:55:30 +0200
commit9a5055af82bdd281e334513e5318c636d63f53ee (patch)
tree2d6cd173497003706022fc6eecd609247e6803e0
parent7b7fcdfef7487770d3089bafaedf467e30ed3afe (diff)
downloadEpisodeBrowser-9a5055af82bdd281e334513e5318c636d63f53ee.tar.gz
Free libraries.
-rw-r--r--c/common.c4
-rw-r--r--c/main.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/c/common.c b/c/common.c
index a44462d..fb76c71 100644
--- a/c/common.c
+++ b/c/common.c
@@ -15,8 +15,10 @@ int Dpi(int i)
extern HWND HWnd;
IDPI = 96;
hModule = LoadLibrary(TEXT("User32.dll"));
- if (hModule && (GetDpiForWindow = GetProcAddress(hModule, "GetDpiForWindow")))
+ if (hModule && (GetDpiForWindow = GetProcAddress(hModule, "GetDpiForWindow"))) {
IDPI = GetDpiForWindow(HWnd);
+ FreeLibrary(hModule);
+ }
}
return MulDiv(i, IDPI, 96);
diff --git a/c/main.c b/c/main.c
index 3f60407..5c705f0 100644
--- a/c/main.c
+++ b/c/main.c
@@ -281,6 +281,7 @@ SetupFonts()
SystemParametersInfo(SPI_GETNONCLIENTMETRICS,
sizeof(NONCLIENTMETRICS), &m, 0);
HfNormal = CreateFontIndirect(&m.lfMessageFont);
+ FreeLibrary(hModule);
} else
HfNormal = GetStockObject(DEFAULT_GUI_FONT);