Bug 569583 - GetParent returns nsWindow::mParent in nsWindow.cpp. r=jimm
authorJean-Luc Bonnafoux <jeanluc.bonnafoux@wanadoo.fr>
Tue, 10 Jan 2017 20:36:16 +0100
changeset 328875 2e56d81973346704883ec09700fffc3bdc657586
parent 328874 926cb3c2f79aa10a59fcdaec5eaf138780a1dcc9
child 328876 c8442d9681094949505bd02c2e65aeda11decfaa
push id31191
push usercbook@mozilla.com
push dateWed, 11 Jan 2017 15:24:19 +0000
treeherdermozilla-central@63ad56438630 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs569583
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 569583 - GetParent returns nsWindow::mParent in nsWindow.cpp. r=jimm
widget/windows/nsWindow.cpp
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -1228,17 +1228,23 @@ nsWindow::ReparentNativeWidget(nsIWidget
   NS_ASSERTION(newParent, "Parent widget has a null native window handle");
   if (newParent && mWnd) {
     ::SetParent(mWnd, newParent);
   }
 }
 
 nsIWidget* nsWindow::GetParent(void)
 {
-  return GetParentWindow(false);
+  if (mIsTopWidgetWindow) {
+    return nullptr;
+  }
+  if (mInDtor || mOnDestroyCalled) {
+    return nullptr;
+  }
+  return mParent;
 }
 
 static int32_t RoundDown(double aDouble)
 {
   return aDouble > 0 ? static_cast<int32_t>(floor(aDouble)) :
                        static_cast<int32_t>(ceil(aDouble));
 }