diff options
author | Noel Grandin <noel@peralex.com> | 2015-03-18 08:33:14 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 11:59:25 +0100 |
commit | 0556598b35eb6d81fdaff04520f14202660f0333 (patch) | |
tree | 2fb64309bbd8e519f25b1e55824bad5513754e91 /vcl/source/app/help.cxx | |
parent | 7aa921cb53eedd0a107fbe9f75365adcce4d37d9 (diff) |
vclwidget: check for calling delete on subclasses of vcl::Window
Change-Id: I7fb7cf919e3f46dd03a18b1cb95fa881915f9642
Diffstat (limited to 'vcl/source/app/help.cxx')
-rw-r--r-- | vcl/source/app/help.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index 50151aca4865..c13acfa7e113 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -229,12 +229,12 @@ void Help::UpdateTip( sal_uIntPtr nId, vcl::Window* pParent, const Rectangle& rS void Help::HideTip( sal_uLong nId ) { - HelpTextWindow* pHelpWin = reinterpret_cast<HelpTextWindow*>(nId); + VclPtr<HelpTextWindow> pHelpWin = reinterpret_cast<HelpTextWindow*>(nId); vcl::Window* pFrameWindow = pHelpWin->ImplGetFrameWindow(); pHelpWin->Hide(); // trigger update, so that a Paint is instantly triggered since we do not save the background pFrameWindow->ImplUpdateAll(); - delete pHelpWin; + pHelpWin.disposeAndClear(); ImplGetSVData()->maHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks(); } @@ -550,7 +550,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, sal_uIn void ImplDestroyHelpWindow( bool bUpdateHideTime ) { ImplSVData* pSVData = ImplGetSVData(); - HelpTextWindow* pHelpWin = pSVData->maHelpData.mpHelpWin; + VclPtr<HelpTextWindow> pHelpWin = pSVData->maHelpData.mpHelpWin; if ( pHelpWin ) { vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow(); @@ -561,7 +561,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime ) pSVData->maHelpData.mpHelpWin = NULL; pSVData->maHelpData.mbKeyboardHelp = false; pHelpWin->Hide(); - delete pHelpWin; + pHelpWin.disposeAndClear(); if( bUpdateHideTime ) pSVData->maHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks(); } |