Kaydet (Commit) 4d322444 authored tarafından Takeshi Abe's avatar Takeshi Abe

Avoid possible memory leaks in case of exceptions

Change-Id: Ib4a87cab2729e18b2c830cbd7e7a34d62b5f0f45
üst 37b9ea92
......@@ -543,14 +543,13 @@ IMPL_LINK( ScOptSolverDlg, BtnHdl, PushButton*, pBtn )
else if ( pBtn == m_pBtnOpt )
{
//! move options dialog to UI lib?
ScSolverOptionsDialog* pOptDlg =
new ScSolverOptionsDialog( this, maImplNames, maDescriptions, maEngine, maProperties );
boost::scoped_ptr<ScSolverOptionsDialog> pOptDlg(
new ScSolverOptionsDialog( this, maImplNames, maDescriptions, maEngine, maProperties ));
if ( pOptDlg->Execute() == RET_OK )
{
maEngine = pOptDlg->GetEngine();
maProperties = pOptDlg->GetProperties();
}
delete pOptDlg;
}
return 0;
......
......@@ -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;
}
}
}
......
......@@ -84,10 +84,9 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{ // Several marks, which should it be?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialog creation failed!");
VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg(pMDI, aMgr);
boost::scoped_ptr<VclAbstractDialog> pMultDlg(pFact->CreateMultiTOXMarkDlg(pMDI, aMgr));
OSL_ENSURE(pMultDlg, "Dialog creation failed!");
nRet = pMultDlg->Execute();
delete pMultDlg;
}
if( nRet == RET_OK)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment