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 /cui/source | |
parent | 7aa921cb53eedd0a107fbe9f75365adcce4d37d9 (diff) |
vclwidget: check for calling delete on subclasses of vcl::Window
Change-Id: I7fb7cf919e3f46dd03a18b1cb95fa881915f9642
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optjava.cxx | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index b0640f8d8efb..4b9763be3c85 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -253,7 +253,7 @@ IMPL_LINK_NOARG(SearchProgress, CleanUpHdl) EndDialog( RET_OK ); - delete this; + VclPtr<SearchProgress>(this).disposeAndClear(); return 0L; } @@ -431,7 +431,7 @@ IMPL_LINK_NOARG(TakeProgress, CleanUpHdl) GetParent()->LeaveWait(); EndDialog( RET_OK ); - delete this; + VclPtr<TakeProgress>(this).disposeAndClear(); return 0L; } diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 9d712d0b23d6..5bf6d6d21e42 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -1498,11 +1498,11 @@ IMPL_LINK( SvxScriptErrorDialog, ShowDialog, OUString*, pMessage ) message = OUString( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); } - MessageDialog* pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING); + VclPtr<MessageDialog> pBox = new MessageDialog(NULL, message, VCL_MESSAGE_WARNING); pBox->SetText( CUI_RES( RID_SVXSTR_ERROR_TITLE ) ); pBox->Execute(); - delete pBox; + pBox.disposeAndClear(); delete pMessage; return 0; diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 7a2334a5b8b9..fe3bd19c6fde 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -437,7 +437,7 @@ IMPL_LINK( SvxJavaOptionsPage, DialogClosedHdl, DialogClosedEvent*, pEvt ) IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl ) { - CuiAboutConfigTabPage* m_pExpertConfigDlg = new CuiAboutConfigTabPage(this); + VclPtr<CuiAboutConfigTabPage> m_pExpertConfigDlg = new CuiAboutConfigTabPage(this); m_pExpertConfigDlg->Reset();//initialize and reset function if( RET_OK == m_pExpertConfigDlg->Execute() ) @@ -445,7 +445,7 @@ IMPL_LINK_NOARG( SvxJavaOptionsPage, ExpertConfigHdl_Impl ) m_pExpertConfigDlg->FillItemSet();//save changes if there are any } - delete m_pExpertConfigDlg; + m_pExpertConfigDlg.disposeAndClear(); return 0; } |