diff --git a/src/kits/interface/Window.cpp b/src/kits/interface/Window.cpp index 37a17a1425..8f23137408 100644 --- a/src/kits/interface/Window.cpp +++ b/src/kits/interface/Window.cpp @@ -2043,7 +2043,14 @@ BWindow::Show() { if (!fRunCalled) { // this is the fist time Show() is called, which implicetly runs the looper - Run(); + if (fLink->SenderPort() < B_OK) { + // We don't have valid app_server connection; there is no point + // in starting our looper + fRunCalled = true; + fTaskID = B_ERROR; + return; + } else + Run(); } if (Lock()) { diff --git a/src/tests/servers/app/stress_test/main.cpp b/src/tests/servers/app/stress_test/main.cpp index aa292f8f5c..5281f1f173 100644 --- a/src/tests/servers/app/stress_test/main.cpp +++ b/src/tests/servers/app/stress_test/main.cpp @@ -104,6 +104,9 @@ TestWindow::TestWindow(BRect frame) BMessenger self(this); BMessage message(B_QUIT_REQUESTED); fPulse = new BMessageRunner(self, &message, 10000000, 1); + + if (Thread() < B_OK) + Quit(); }