use unique_ptr for mpWinData
Change-Id: I38a9cedc3041a78160536b40bd369df767101de5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109993 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
b2ebceeaf4
commit
ed6765d318
+1
-1
@@ -221,7 +221,7 @@ public:
|
||||
WindowImpl( WindowType );
|
||||
~WindowImpl();
|
||||
|
||||
ImplWinData* mpWinData;
|
||||
std::unique_ptr<ImplWinData> mpWinData;
|
||||
ImplFrameData* mpFrameData;
|
||||
SalFrame* mpFrame;
|
||||
SalObject* mpSysObj;
|
||||
|
||||
@@ -517,8 +517,7 @@ void Window::dispose()
|
||||
}
|
||||
}
|
||||
|
||||
delete mpWindowImpl->mpWinData;
|
||||
mpWindowImpl->mpWinData = nullptr;
|
||||
mpWindowImpl->mpWinData.reset();
|
||||
|
||||
// remove BorderWindow or Frame window data
|
||||
mpWindowImpl->mpBorderWindow.disposeAndClear();
|
||||
@@ -1214,11 +1213,11 @@ ImplWinData* Window::ImplGetWinData() const
|
||||
{
|
||||
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
|
||||
|
||||
const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData = new ImplWinData;
|
||||
const_cast<vcl::Window*>(this)->mpWindowImpl->mpWinData.reset(new ImplWinData);
|
||||
mpWindowImpl->mpWinData->mbEnableNativeWidget = !(pNoNWF && *pNoNWF); // true: try to draw this control with native theme API
|
||||
}
|
||||
|
||||
return mpWindowImpl->mpWinData;
|
||||
return mpWindowImpl->mpWinData.get();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user