diff options
author | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2020-05-05 13:55:11 +0200 |
---|---|---|
committer | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2020-05-07 21:57:03 +0200 |
commit | 8a28836d1d57ace31fea629a1ad9eaec0006d97d (patch) | |
tree | e798ec186e9315c7e1f2e6d8df219a16928bc182 | |
parent | d36ca86b7fa95271044a1bfcd6e8613289215fb8 (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.c | 1 |
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, |