From 4d32244437475688ca951ce30f8d6fcc59fc1caa Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Tue, 26 Aug 2014 17:50:33 +0900 Subject: Avoid possible memory leaks in case of exceptions Change-Id: Ib4a87cab2729e18b2c830cbd7e7a34d62b5f0f45 --- scripting/source/protocolhandler/scripthandler.cxx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'scripting/source/protocolhandler/scripthandler.cxx') diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx index b5760b613bc9..e959d3fe6ef6 100644 --- a/scripting/source/protocolhandler/scripthandler.cxx +++ b/scripting/source/protocolhandler/scripthandler.cxx @@ -273,14 +273,11 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification( if ( pFact != NULL ) { - VclAbstractDialog* pDlg = - pFact->CreateScriptErrorDialog( NULL, aException ); + boost::scoped_ptr pDlg( + pFact->CreateScriptErrorDialog( NULL, aException )); - if ( pDlg != NULL ) - { + if ( pDlg ) pDlg->Execute(); - delete pDlg; - } } } -- cgit