diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-01-26 20:58:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-01-27 07:38:32 +0100 |
commit | ed6765d3181fa1a97fe5d7766b748a7976b6f29a (patch) | |
tree | 7cf8ae5cac992acb3c588ecc4c91534772f7d1f9 /vcl/source | |
parent | b2ebceeaf49aa45979486997e6358697b7045361 (diff) |
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>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/window.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 6b43b4793c43..e21cacd71c07 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -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(); } |