diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index e0c4b7d63d41..0be198fdb366 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -141,7 +141,6 @@ nsBaseWidget::nsBaseWidget(nsBorderStyle aBorderStyle) mCompositorVsyncDispatcher(nullptr), mBorderStyle(aBorderStyle), mBounds(0, 0, 0, 0), - mOriginalBounds(nullptr), mIsTiled(false), mPopupLevel(ePopupLevelTop), mPopupType(ePopupTypeAny), @@ -403,8 +402,6 @@ nsBaseWidget::~nsBaseWidget() { gNumWidgets--; printf("WIDGETS- = %d\n", gNumWidgets); #endif - - delete mOriginalBounds; } //------------------------------------------------------------------------- @@ -723,7 +720,7 @@ void nsBaseWidget::InfallibleMakeFullScreen(bool aFullScreen) { if (aFullScreen) { if (!mOriginalBounds) { - mOriginalBounds = new LayoutDeviceIntRect(); + mOriginalBounds = mozilla::MakeUnique(); } *mOriginalBounds = GetScreenBounds(); diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index cf42a3480245..ee8260549faf 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -711,7 +711,7 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference { Cursor mCursor; nsBorderStyle mBorderStyle; LayoutDeviceIntRect mBounds; - LayoutDeviceIntRect* mOriginalBounds; + mozilla::UniquePtr mOriginalBounds; bool mIsTiled; nsPopupLevel mPopupLevel; nsPopupType mPopupType;