diff options
Diffstat (limited to 'src/libui_sdl')
-rw-r--r-- | src/libui_sdl/libui/windows/alloc.cpp | 1 | ||||
-rw-r--r-- | src/libui_sdl/main.cpp | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/windows/alloc.cpp b/src/libui_sdl/libui/windows/alloc.cpp index eeee3ad..cf6bd2e 100644 --- a/src/libui_sdl/libui/windows/alloc.cpp +++ b/src/libui_sdl/libui/windows/alloc.cpp @@ -22,6 +22,7 @@ void uninitAlloc(void) // note the void * cast; otherwise it'll be treated as a string oss << (void *) (alloc.first) << " " << types[alloc.second] << "\n"; ossstr = oss.str(); + printf("data leak: %s\n", ossstr.c_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()); } diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index b952045..b40c9d1 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -96,6 +96,8 @@ int EmuThreadFunc(void* burp) u32 nlines = NDS::RunFrame(); //SDL_UnlockMutex(ScreenMutex); + if (EmuRunning == 0) break; + uiAreaQueueRedrawAll(MainDrawArea); // framerate limiter based off SDL2_gfx @@ -266,6 +268,9 @@ void OnOpenFile(uiMenuItem* item, uiWindow* window, void* blarg) if (!file) return; NDS::LoadROM(file, Config::DirectBoot); + uiFreeText(file); + // TODO: change libui to store strings in stack-allocated buffers? + // so we don't have to free it after use EmuRunning = 1; } |