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
This commit is contained in:
Stephan Aßmus
2006-03-11 19:38:20 +00:00
parent d26af39650
commit a0cfff3e97
+4 -2
View File
@@ -151,7 +151,8 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
float frequency; float frequency;
if (fDesktop->ScreenAt(0)) { if (fDesktop->ScreenAt(0)) {
fDesktop->ScreenAt(0)->GetMode(width, height, colorSpace, frequency); 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); fFrame.OffsetTo(B_ORIGIN);
// ResizeBy(width - frame.Width(), height - frame.Height(), NULL); // ResizeBy(width - frame.Width(), height - frame.Height(), NULL);
} }
@@ -166,7 +167,8 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
WindowLayer::~WindowLayer() WindowLayer::~WindowLayer()
{ {
fTopLayer->DetachedFromWindow(); if (fTopLayer)
fTopLayer->DetachedFromWindow();
delete fTopLayer; delete fTopLayer;
delete fDecorator; delete fDecorator;