Apache OpenOffice (AOO) Bugzilla – Issue 120746
The FormScriptingEnvironment object created in the FmXUndoEnvironment ctor is never released
Last modified: 2016-04-09 10:38:54 UTC
In FmXUndoEnvironment ctor, it calls m_pScriptingEnv( ::svxform::createDefaultFormScriptingEnvironment( _rModel ) ) creates a FormScriptingEnvironment object. And in svxform::FormScriptingEnvironment ctor api, it creates ListenerImplementation object, FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel ) :m_refCount( 0 ) ,m_pScriptListener( NULL ) ,m_rFormModel( _rModel ) ,m_bDisposed( false ) { m_pScriptListener = ListenerImplementation( new FormScriptListener( this ) ); // note that this is a cyclic reference between the FormScriptListener and the FormScriptingEnvironment // This cycle is broken up when our instance is disposed. } So there is cyclic reference between FormScriptingEnvironment and ListenerImplementation object. It needs call to it's FormScriptingEnvironment::dispose() api to break the cyclic reference before it can be released. But before FmXUndoEnvironment::~FmXUndoEnvironment() is called, FmXUndoEnvironment::dispose() is not never called, so the svxform::FormScriptingEnvironment object get leaked.
Created attachment 79208 [details] fix code patch Because FmXUndoEnvironment::dispose() is not a public API and it does call to FmXUndoEnvironment::dispose(). we can not depend on it. The proposed fix is just to call FmXUndoEnvironment::dispose() in FmXUndoEnvironment dtor api.
"zhangjf" committed SVN revision 1380986 into trunk: #i120746#, the FormScriptingEnvironment object created in the FmXUndoEnvironm...
Change to resolved state
fixed in 4.0.0