User: obo     
Date: 05/05/06 02:18:48

Modified:
 /dba/dbaccess/source/core/dataaccess/
  databasedocument.cxx

Log:
 INTEGRATION: CWS dba20a (1.17.14); FILE MERGED
 2005/05/04 07:06:56 oj 1.17.14.1: #i48625# set parent to NULL when document is 
in disposing

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: databasedocument.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/databasedocument.cxx?r1=1.17&r2=1.18
Delta lines:  +28 -0
--------------------
--- databasedocument.cxx        6 Apr 2005 09:47:25 -0000       1.17
+++ databasedocument.cxx        6 May 2005 09:18:46 -0000       1.18
@@ -218,6 +218,19 @@
     {
         OSL_ENSURE(0,"Could not create GlobalEventBroadcaster!");
     }
+       Reference<XChild> xChild(m_pImpl->m_xForms.get(),UNO_QUERY);
+       if ( xChild.is() )
+               xChild->setParent(static_cast<OWeakObject*>(this));
+
+       xChild.set(m_pImpl->m_xReports.get(),UNO_QUERY);
+       if ( xChild.is() )
+               xChild->setParent(static_cast<OWeakObject*>(this));
+       xChild.set(m_pImpl->m_xTableDefinitions.get(),UNO_QUERY);
+       if ( xChild.is() )
+               xChild->setParent(static_cast<OWeakObject*>(this));
+       xChild.set(m_pImpl->m_xCommandDefinitions.get(),UNO_QUERY);
+       if ( xChild.is() )
+               xChild->setParent(static_cast<OWeakObject*>(this));
 }
 //--------------------------------------------------------------------------
 ODatabaseDocument::~ODatabaseDocument()
@@ -1100,6 +1113,7 @@
 
//------------------------------------------------------------------------------
 void ODatabaseDocument::disposing()
 {
+       Reference<XInterface> xHold = m_pImpl->m_xModel;        
     {
            
notifyEvent(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnload")));
         if ( m_pChildCommitListen )
@@ -1121,6 +1135,20 @@
                    if ( xComp.is() )
                            xComp->removeEventListener( static_cast< 
XTransactionListener* >( this ) );
            }
+
+               Reference<XChild> xChild(m_pImpl->m_xForms.get(),UNO_QUERY);
+               if ( xChild.is() )
+                       xChild->setParent(NULL);
+               
+               xChild.set(m_pImpl->m_xReports.get(),UNO_QUERY);
+               if ( xChild.is() )
+                       xChild->setParent(NULL);
+               xChild.set(m_pImpl->m_xTableDefinitions.get(),UNO_QUERY);
+               if ( xChild.is() )
+                       xChild->setParent(NULL);
+               xChild.set(m_pImpl->m_xCommandDefinitions.get(),UNO_QUERY);
+               if ( xChild.is() )
+                       xChild->setParent(NULL);
 
            m_pImpl->m_xModel.clear();
     }




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to