diff options
Diffstat (limited to 'vcl/source/outdev/outdev.cxx')
-rw-r--r-- | vcl/source/outdev/outdev.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index b44eedda0818..82833c72d819 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -62,7 +62,7 @@ OutputDevice::OutputDevice() : mpFontCollection = nullptr; mpDeviceFontList = nullptr; mpDeviceFontSizeList = nullptr; - mpOutDevStateStack = new OutDevStateStack; + mpOutDevStateStack.reset(new OutDevStateStack); mpPDFWriter = nullptr; mpAlphaVDev = nullptr; mpExtOutDevData = nullptr; @@ -128,7 +128,7 @@ OutputDevice::OutputDevice() : maThresRes.mnThresPixToLogY = 0; // struct ImplOutDevData- see #i82615# - mpOutDevData = new ImplOutDevData; + mpOutDevData.reset(new ImplOutDevData); mpOutDevData->mpRotateDev = nullptr; mpOutDevData->mpRecordLayout = nullptr; @@ -158,8 +158,7 @@ void OutputDevice::dispose() // #i75163# ImplInvalidateViewTransform(); - delete mpOutDevData; - mpOutDevData = nullptr; + mpOutDevData.reset(); // for some reason, we haven't removed state from the stack properly if ( !mpOutDevStateStack->empty() ) @@ -170,20 +169,15 @@ void OutputDevice::dispose() mpOutDevStateStack->pop_back(); } } - delete mpOutDevStateStack; - mpOutDevStateStack = nullptr; + mpOutDevStateStack.reset(); // release the active font instance if( mpFontInstance ) mpFontInstance->Release(); // remove cached results of GetDevFontList/GetDevSizeList - // TODO: use smart pointers for them - delete mpDeviceFontList; - mpDeviceFontList = nullptr; - - delete mpDeviceFontSizeList; - mpDeviceFontSizeList = nullptr; + mpDeviceFontList.reset(); + mpDeviceFontSizeList.reset(); // release ImplFontCache specific to this OutputDevice // TODO: refcount ImplFontCache |