You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by zh...@apache.org on 2012/09/05 04:54:08 UTC

svn commit: r1380957 - /incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx

Author: zhangjf
Date: Wed Sep  5 02:54:08 2012
New Revision: 1380957

URL: http://svn.apache.org/viewvc?rev=1380957&view=rev
Log:
#i120738#, in Storage::release(), need call to OWeakObject::release() explicitly to make sure the week object is released correctly. 

Found by: zhangjf 
Patch by: zhangjf

Modified:
    incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx

Modified: incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx?rev=1380957&r1=1380956&r2=1380957&view=diff
==============================================================================
--- incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx (original)
+++ incubator/ooo/trunk/main/ucb/source/ucp/tdoc/tdoc_stgelems.cxx Wed Sep  5 02:54:08 2012
@@ -191,11 +191,14 @@ void SAL_CALL Storage::acquire()
 void SAL_CALL Storage::release()
     throw ()
 {
-    if ( osl_decrementInterlockedCount( &m_refCount ) == 0 )
-    {
+    //#i120738, Storage::release overrides OWeakObject::release(), 
+    //need call OWeakObject::release() to release OWeakObject::m_pWeakConnectionPoint
+    
+    if ( m_refCount == 1 )
         m_xFactory->releaseElement( this );
-        delete this;
-    }
+
+    //delete this;
+    OWeakObject::release();
 }
 
 //=========================================================================