incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 120746] New: The FormScriptingEnvironment object created in the FmXUndoEnvironment ctor is never released
Date Wed, 29 Aug 2012 06:38:30 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=120746

          Priority: P3
            Bug ID: 120746
          Assignee: ooo-issues@incubator.apache.org
           Summary: The FormScriptingEnvironment object created in the
                    FmXUndoEnvironment ctor is never released
          Severity: normal
        Issue Type: DEFECT
    Classification: Code
                OS: All
          Reporter: zhangjf@apache.org
          Hardware: All
            Status: CONFIRMED
           Version: AOO 3.4.0
         Component: code
           Product: performance

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Mime
View raw message