summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Faye-Lund <erik.faye-lund@collabora.com>2020-05-05 13:55:11 +0200
committerErik Faye-Lund <erik.faye-lund@collabora.com>2020-05-07 21:57:03 +0200
commit8a28836d1d57ace31fea629a1ad9eaec0006d97d (patch)
treee798ec186e9315c7e1f2e6d8df219a16928bc182
parentd36ca86b7fa95271044a1bfcd6e8613289215fb8 (diff)
wglgears: destroy old window when recreating
Even if the window is not yet displayed, the object still exists and takes up memory. So let's destroy it before recreating. Fixes: 14688d84 ("wglgears.c: add -srgb option") Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--src/wgl/wglgears.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wgl/wglgears.c b/src/wgl/wglgears.c
index 5d2bb015..9efebea9 100644
--- a/src/wgl/wglgears.c
+++ b/src/wgl/wglgears.c
@@ -488,6 +488,7 @@ make_window(const char *name, int x, int y, int width, int height)
wglDeleteContext(hRC);
DeleteDC(hDC);
+ DestroyWindow(hWnd);
hWnd = CreateWindowEx(dwExStyle, name, name,
WS_CLIPSIBLINGS | WS_CLIPCHILDREN | dwStyle,
x, y,