diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-14 19:06:41 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-03-14 19:06:41 +0100 |
commit | 9cb96b7ddded318c9ef967865f67d6b8d5cfd01a (patch) | |
tree | df4d9ca258b47276d4b2ad79fa4a077db515b292 /plugingui/plugingui.cc | |
parent | e877e74632632e1b798ca791e2c30376ae4a5732 (diff) |
Fix GUI crash on close.
Diffstat (limited to 'plugingui/plugingui.cc')
-rw-r--r-- | plugingui/plugingui.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/plugingui/plugingui.cc b/plugingui/plugingui.cc index 7e4bb59..3fb5984 100644 --- a/plugingui/plugingui.cc +++ b/plugingui/plugingui.cc @@ -141,11 +141,13 @@ PluginGUI::PluginGUI(DrumGizmo *drumgizmo) #else init(); #endif/*USE_THREAD*/ + + sem.wait(); } PluginGUI::~PluginGUI() { - printf("~PluginGUI()\n"); + DEBUG(plugingui, "~PluginGUI()\n"); running = false; wait_stop(); @@ -280,6 +282,8 @@ void PluginGUI::init() fb = filebrowser; window->show(); + + sem.post(); } static bool shown = false; @@ -328,6 +332,7 @@ void PluginGUI::setChangeMidimapCallback(void (*handler)(void *, const char *), void stop(void *ptr) { + DEBUG(stop, "Stopping...\n"); bool *running = (bool*)ptr; *running = false; } @@ -350,7 +355,7 @@ int main() bool running = true; PluginGUI gui(NULL); - //gui.setWindowClosedCallback(stop, &running); + gui.setWindowClosedCallback(stop, &running); // gui.show(); @@ -358,7 +363,6 @@ int main() // gui.processEvents(); #ifdef WIN32 SleepEx(1000, FALSE); - printf("loop\n"); #else // usleep(10000); sleep(1); |