summaryrefslogtreecommitdiff
path: root/forms/source/component
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-04-14 21:28:02 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2014-04-14 21:47:43 +0900
commitfbf5599c071c6f3203f8992aba4560be9b3b5e42 (patch)
treef15465bdebc3b9d424b010ae1afc8960401c875e /forms/source/component
parente04c36b4591ffa457f3072ea8d3c0c72211d20c7 (diff)
Avoid possible memory leaks in case of exceptions
Change-Id: Id71cb49d8aa241a17efd4cbe217a48f2d7c34e84
Diffstat (limited to 'forms/source/component')
-rw-r--r--forms/source/component/EventThread.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx
index 6a5b0a6c0e0e..d385ee893b43 100644
--- a/forms/source/component/EventThread.cxx
+++ b/forms/source/component/EventThread.cxx
@@ -20,7 +20,7 @@
#include "EventThread.hxx"
#include <comphelper/guarding.hxx>
#include <tools/debug.hxx>
-
+#include <boost/scoped_ptr.hpp>
namespace frm
{
@@ -176,7 +176,7 @@ void OComponentEventThread::run()
::cppu::OComponentHelper *pCompImpl = m_pCompImpl;
ThreadEvents::iterator firstEvent( m_aEvents.begin() );
- EventObject* pEvt = *firstEvent;
+ boost::scoped_ptr<EventObject> pEvt(*firstEvent);
m_aEvents.erase( firstEvent );
ThreadObjects::iterator firstControl( m_aControls.begin() );
@@ -196,10 +196,8 @@ void OComponentEventThread::run()
query_interface(xControlAdapter->queryAdapted(), xControl);
if( xComp.is() )
- processEvent( pCompImpl, pEvt, xControl, bFlag );
+ processEvent( pCompImpl, pEvt.get(), xControl, bFlag );
}
-
- delete pEvt;
};
// After a Dispose, we do not know the Control anymore.