Some objects must be destroyed on server quit.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11613 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-03-07 21:52:41 +00:00
parent a85419eec3
commit d29c4f5287

View File

@ -48,7 +48,7 @@
#include "FontServer.h" #include "FontServer.h"
#include "Desktop.h" #include "Desktop.h"
#include "RootLayer.h" #include "RootLayer.h"
#include <StopWatch.h>
//#define DEBUG_KEYHANDLING //#define DEBUG_KEYHANDLING
//#define DEBUG_SERVER //#define DEBUG_SERVER
@ -164,7 +164,8 @@ AppServer::AppServer(void)
*/ */
AppServer::~AppServer(void) AppServer::~AppServer(void)
{ {
debugger("We shouldn't be here! MainLoop()::B_QUIT_REQUESTED should see if we can exit the server.\n");
/*
ServerApp *tempapp; ServerApp *tempapp;
int32 i; int32 i;
acquire_sem(fAppListLock); acquire_sem(fAppListLock);
@ -189,6 +190,7 @@ AppServer::~AppServer(void)
delete fontserver; delete fontserver;
make_decorator=NULL; make_decorator=NULL;
*/
} }
/*! /*!
@ -630,7 +632,6 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg)
ServerApp *app= NULL; ServerApp *app= NULL;
acquire_sem(fAppListLock); acquire_sem(fAppListLock);
thread_info tinfo; thread_info tinfo;
for(int32 i= 0; i < fAppList->CountItems(); i++) for(int32 i= 0; i < fAppList->CountItems(); i++)
{ {
app=(ServerApp*)fAppList->ItemAt(i); app=(ServerApp*)fAppList->ItemAt(i);
@ -668,8 +669,11 @@ void AppServer::DispatchMessage(int32 code, BPortLink &msg)
release_sem(fAppListLock); release_sem(fAppListLock);
delete desktop; delete desktop;
delete fAppList;
delete bitmapmanager;
delete fontserver;
make_decorator=NULL;
// When we delete the last ServerApp, we can exit the server
exit_thread(0); exit_thread(0);
// we are now clear to exit // we are now clear to exit