diff options
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/EventThread.cxx | 8 | ||||
-rw-r--r-- | forms/source/richtext/richtextengine.cxx | 5 |
2 files changed, 5 insertions, 8 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. diff --git a/forms/source/richtext/richtextengine.cxx b/forms/source/richtext/richtextengine.cxx index 4712a61fbf13..1a1cb0cb6250 100644 --- a/forms/source/richtext/richtextengine.cxx +++ b/forms/source/richtext/richtextengine.cxx @@ -35,7 +35,7 @@ #include <algorithm> #include <functional> - +#include <boost/scoped_ptr.hpp> namespace frm { @@ -85,14 +85,13 @@ namespace frm RichTextEngine* pClone( NULL ); { SolarMutexGuard aGuard; - EditTextObject* pMyText = CreateTextObject(); + boost::scoped_ptr<EditTextObject> pMyText(CreateTextObject()); OSL_ENSURE( pMyText, "RichTextEngine::Clone: CreateTextObject returned nonsense!" ); pClone = Create(); if ( pMyText ) pClone->SetText( *pMyText ); - delete pMyText; } return pClone; |