Avoid possible memory leaks in case of exceptions

Change-Id: Ib4a87cab2729e18b2c830cbd7e7a34d62b5f0f45
This commit is contained in:
Takeshi Abe
2014-08-26 17:50:33 +09:00
parent 37b9ea92ba
commit 4d32244437
3 changed files with 6 additions and 11 deletions

View File

@@ -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;
}
}
}