From 1e263930ebc6d1871c43bb70bc21c4917efaff1e Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 22:46:15 -0400 Subject: Started working on code to monitor creation and deletion of UI objects correctly. --- new/window_windows.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'new/window_windows.c') diff --git a/new/window_windows.c b/new/window_windows.c index b4d0163..1952b15 100644 --- a/new/window_windows.c +++ b/new/window_windows.c @@ -45,6 +45,10 @@ static LRESULT CALLBACK uiWindowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPA if (!(*(w->onClosing))(w, w->onClosingData)) return 0; break; // fall through to DefWindowProcW() + case WM_DESTROY: +printf("destroying window; freeing uiWindow\n"); + uiFree(w); + break; // fall through to DefWindowProcW() } return DefWindowProcW(hwnd, uMsg, wParam, lParam); } @@ -104,7 +108,6 @@ uiWindow *uiNewWindow(char *title, int width, int height) void uiWindowDestroy(uiWindow *w) { DestroyWindow(w->hwnd); - uiFree(w); } uintptr_t uiWindowHandle(uiWindow *w) -- cgit v1.2.3