From bc63570c9b4445304dfd38ce6927946a351720c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sun, 12 Mar 2006 22:59:49 +0000 Subject: [PATCH] BWindow::Show() will no longer Run() its looper without a valid app_server connection. StressTest now detects this case and quits those windows. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16752 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Window.cpp | 9 ++++++++- src/tests/servers/app/stress_test/main.cpp | 3 +++ 2 files changed, 11 insertions(+), 1 deletion(-) 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(); }