fixed the problems Ingo pointed out

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca
2004-01-17 16:35:00 +00:00
parent 0a8120dd1c
commit dc3ebdec6c
+9 -8
View File
@@ -60,6 +60,7 @@
// Local Includes -------------------------------------------------------------- // Local Includes --------------------------------------------------------------
// Local Defines --------------------------------------------------------------- // Local Defines ---------------------------------------------------------------
#define RUN_WITHOUT_REGISTRAR
// Globals --------------------------------------------------------------------- // Globals ---------------------------------------------------------------------
BApplication* be_app = NULL; BApplication* be_app = NULL;
@@ -220,11 +221,8 @@ BApplication::BApplication(const char* signature, status_t* error)
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
BApplication::~BApplication() BApplication::~BApplication()
{ {
// unregister from the roster
BRoster::Private().RemoveApp(Team());
// tell all loopers(usualy windows) to quit. Also, wait for them. // tell all loopers(usualy windows) to quit. Also, wait for them.
BLooper* Looper = NULL; BWindow* window = NULL;
BList looperList; BList looperList;
{ {
using namespace BPrivate; using namespace BPrivate;
@@ -235,14 +233,17 @@ BApplication::~BApplication()
for (int32 i = 0; i < looperList.CountItems(); i++) for (int32 i = 0; i < looperList.CountItems(); i++)
{ {
Looper = dynamic_cast<BLooper*>((BLooper*)looperList.ItemAt(i)); window = dynamic_cast<BWindow*>((BLooper*)looperList.ItemAt(i));
if (Looper && Looper != this) if (window)
{ {
Looper->Lock(); window->Lock();
Looper->Quit(); window->Quit();
} }
} }
// unregister from the roster
BRoster::Private().RemoveApp(Team());
// tell app_server we're quiting... // tell app_server we're quiting...
PortLink link(fServerFrom); PortLink link(fServerFrom);
link.SetOpCode(B_QUIT_REQUESTED); link.SetOpCode(B_QUIT_REQUESTED);