From 56cb25b230e69718f60734a5772b0db19c681ec7 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 29 May 2016 13:07:48 -0400 Subject: [PATCH] Started Windows TODO resolution. --- windows/alloc.cpp | 5 +++-- windows/area.cpp | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/windows/alloc.cpp b/windows/alloc.cpp index 9511c881..eeee3ad4 100644 --- a/windows/alloc.cpp +++ b/windows/alloc.cpp @@ -14,14 +14,15 @@ void initAlloc(void) void uninitAlloc(void) { std::ostringstream oss; + std::string ossstr; // keep alive, just to be safe if (heap.size() == 0) return; for (const auto &alloc : heap) // note the void * cast; otherwise it'll be treated as a string oss << (void *) (alloc.first) << " " << types[alloc.second] << "\n"; - // TODO keep oss.str() alive? - userbug("Some data was leaked; either you left a uiControl lying around or there's a bug in libui itself. Leaked data:\n%s", oss.str().c_str()); + ossstr = oss.str(); + userbug("Some data was leaked; either you left a uiControl lying around or there's a bug in libui itself. Leaked data:\n%s", ossstr.c_str()); } #define rawBytes(pa) (&((*pa)[0])) diff --git a/windows/area.cpp b/windows/area.cpp index bdad93f5..b4a87517 100644 --- a/windows/area.cpp +++ b/windows/area.cpp @@ -69,7 +69,8 @@ ATOM registerAreaClass(HICON hDefaultIcon, HCURSOR hDefaultCursor) wc.hIcon = hDefaultIcon; wc.hCursor = hDefaultCursor; wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1); - // TODO specify CS_HREDRAW/CS_VREDRAW in addition to or instead of calling InvalidateRect(NULL) in WM_WINDOWPOSCHANGED above, or not at all? + // this is just to be safe; see the InvalidateRect() call in the WM_WINDOWPOSCHANGED handler for more details + wc.style = CS_HREDRAW | CS_VREDRAW; return RegisterClassW(&wc); }