From a0cfff3e97c75bfe045d2745b7d7ccc9e7cfcf9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 11 Mar 2006 19:38:20 +0000 Subject: [PATCH] fix crash in case fTopLayer is NULL when the window is destructed, this will happen when the ServerWindow thread could not be run git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16717 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/WindowLayer.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/servers/app/WindowLayer.cpp b/src/servers/app/WindowLayer.cpp index 396b406e49..851ed3d7ee 100644 --- a/src/servers/app/WindowLayer.cpp +++ b/src/servers/app/WindowLayer.cpp @@ -151,7 +151,8 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name, float frequency; if (fDesktop->ScreenAt(0)) { fDesktop->ScreenAt(0)->GetMode(width, height, colorSpace, frequency); -// TODO: MOVE THIS AWAY!!! RemoveBy contains calls to virtual methods! Also, there is not TopLayer()! +// TODO: MOVE THIS AWAY!!! ResizeBy contains calls to virtual methods! +// Also, there is no TopLayer()! fFrame.OffsetTo(B_ORIGIN); // ResizeBy(width - frame.Width(), height - frame.Height(), NULL); } @@ -166,7 +167,8 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name, WindowLayer::~WindowLayer() { - fTopLayer->DetachedFromWindow(); + if (fTopLayer) + fTopLayer->DetachedFromWindow(); delete fTopLayer; delete fDecorator;