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