Added a check to make sure 'parent' is valid, otherwise a crash could occur
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1150,11 +1150,14 @@ void wxWindow::DoGetPosition(int *x, int *y) const
|
||||
::ScreenToClient(hParentWnd, &point);
|
||||
}
|
||||
|
||||
// We may be faking the client origin. So a window that's really at (0,
|
||||
// 30) may appear (to wxWin apps) to be at (0, 0).
|
||||
wxPoint pt(parent->GetClientAreaOrigin());
|
||||
point.x -= pt.x;
|
||||
point.y -= pt.y;
|
||||
if ( parent )
|
||||
{
|
||||
// We may be faking the client origin. So a window that's really at (0,
|
||||
// 30) may appear (to wxWin apps) to be at (0, 0).
|
||||
wxPoint pt(parent->GetClientAreaOrigin());
|
||||
point.x -= pt.x;
|
||||
point.y -= pt.y;
|
||||
}
|
||||
}
|
||||
|
||||
if ( x )
|
||||
|
Reference in New Issue
Block a user