Delete the application object from the correct thread. The previous

version attempted to Quit() and then immediately delete the app object
from another thread. This triggered a debug assert since in the latter
case we push a quit message onto the looper's message queue and let that
handle terminating the message loop. As a consequence, it was possible for
said looper thread to not have finished shutting down properly before we
called delete, leading to a debug assert with respect to calling delete on a
still running looper. Should correctly fix the crash on terminating the 
test app_server.




git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43030 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent 2011-10-31 13:13:30 +00:00
parent cddcc2bea9
commit 89a1a98bca

View File

@ -104,6 +104,7 @@ run_app_thread(void* cookie)
if (BApplication* app = (BApplication*)cookie) {
app->Lock();
app->Run();
delete app;
}
return 0;
}