Fix potential NULL pointer access
This commit is contained in:
+2
-3
@@ -53,10 +53,9 @@ Window::~Window()
|
||||
|
||||
void Window::attach(Window * newParent)
|
||||
{
|
||||
if (parent)
|
||||
detach();
|
||||
if (parent) detach();
|
||||
parent = newParent;
|
||||
newParent->addChild(this);
|
||||
if (newParent) newParent->addChild(this);
|
||||
}
|
||||
|
||||
void Window::detach()
|
||||
|
||||
Reference in New Issue
Block a user