From 4ed0f43872ac031e5eed616025bce5d1d4f3b63d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Wed, 6 Jul 2005 23:24:03 +0000 Subject: [PATCH] checks rootLayer Pointer, since offscreen windows are not attached to RootLayer. This shouldn't have been a problem though since Offscreen windows were never Show()n git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13515 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/ServerWindow.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/servers/app/ServerWindow.cpp b/src/servers/app/ServerWindow.cpp index fcc710cef8..96ecee261e 100644 --- a/src/servers/app/ServerWindow.cpp +++ b/src/servers/app/ServerWindow.cpp @@ -241,10 +241,10 @@ ServerWindow::Show() return; RootLayer* rootLayer = fWinBorder->GetRootLayer(); - - rootLayer->Lock(); - rootLayer->ShowWinBorder(fWinBorder); - rootLayer->Unlock(); + if (rootLayer && rootLayer->Lock()) { + rootLayer->ShowWinBorder(fWinBorder); + rootLayer->Unlock(); + } } //! Hides the window's WinBorder @@ -258,10 +258,10 @@ ServerWindow::Hide() return; RootLayer* rootLayer = fWinBorder->GetRootLayer(); - - rootLayer->Lock(); - rootLayer->HideWinBorder(fWinBorder); - rootLayer->Unlock(); + if (rootLayer && rootLayer->Lock()) { + rootLayer->HideWinBorder(fWinBorder); + rootLayer->Unlock(); + } } @@ -650,7 +650,6 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link) STRACE(("DONE: ServerWindow %s: Message AS_DELETE_LAYER: Parent: %s Layer: %s\n", fTitle, parent->Name(), fCurrentLayer->Name())); delete fCurrentLayer; -// TODO: Does the client know about this change? fCurrentLayer = parent; break; }