diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-08-26 17:50:33 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-08-26 19:47:14 +0900 |
commit | 4d32244437475688ca951ce30f8d6fcc59fc1caa (patch) | |
tree | f4a613a49fc7d9a790714b6c38ae2fcae979d7b6 /scripting/source/protocolhandler/scripthandler.cxx | |
parent | 37b9ea92ba81d74764a2345a9c75c65bfd272d2b (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: Ib4a87cab2729e18b2c830cbd7e7a34d62b5f0f45
Diffstat (limited to 'scripting/source/protocolhandler/scripthandler.cxx')
-rw-r--r-- | scripting/source/protocolhandler/scripthandler.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
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<VclAbstractDialog> pDlg( + pFact->CreateScriptErrorDialog( NULL, aException )); - if ( pDlg != NULL ) - { + if ( pDlg ) pDlg->Execute(); - delete pDlg; - } } } |