[Libreoffice-commits] core.git: Branch 'feature/vclref' - include/vcl vcl/source

Noel Grandin noel at peralex.com
Fri Mar 13 05:02:08 PDT 2015


 include/vcl/vclptr.hxx       |    2 +-
 vcl/source/window/window.cxx |   17 +++++++----------
 2 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit 5502baee8833b9681279f85909d75f6248a19187
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Mar 13 13:42:34 2015 +0200

    vclwidget: call disposeOnce from VclPtr::disposeAndClear
    
    Change-Id: Ia8c438984409a7b719f5756f9be30ba9e90c57dc

diff --git a/include/vcl/vclptr.hxx b/include/vcl/vclptr.hxx
index 832d608..b64824b 100644
--- a/include/vcl/vclptr.hxx
+++ b/include/vcl/vclptr.hxx
@@ -179,7 +179,7 @@ public:
         ::rtl::Reference<reference_type> aTmp(m_rInnerRef);
         m_rInnerRef.clear(); // we should use some 'swap' method ideally ;-)
         if (aTmp.get()) {
-            aTmp->dispose();
+            aTmp->disposeOnce();
         }
     }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2a453ab..ad74ba0 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -139,18 +139,15 @@ bool Window::IsDisposed() const
 
 void Window::disposeOnce()
 {
-    if (!IsDisposed())
-        dispose();
+    if (!mpWindowImpl || mpWindowImpl->mbInDispose)
+        return;
+    mpWindowImpl->mbInDispose = true;
+    dispose();
 }
 
 void Window::dispose()
 {
-    if (IsDisposed())
-        return;
-
-    assert( !mpWindowImpl->mbInDispose && "vcl::Window - already in dispose()" );
-    mpWindowImpl->mbInDispose = true;
-
+    assert( mpWindowImpl && mpWindowImpl->mbInDispose ); // should only be called from disposeOnce()
     assert( !mpWindowImpl->mpParent ||
             !mpWindowImpl->mpParent->IsDisposed() ||
             "vcl::Window child should have its parent disposed first" );
@@ -605,8 +602,8 @@ WindowImpl::WindowImpl( WindowType nType )
     mpOverlapWindow                     = NULL;                      // first overlap parent
     mpBorderWindow                      = NULL;                      // Border-Window
     mpClientWindow                      = NULL;                      // Client-Window of a FrameWindow
-    mpParent                            = NULL;                      // parent (inkl. BorderWindow)
-    mpRealParent                        = NULL;                      // real parent (exkl. BorderWindow)
+    mpParent                            = NULL;                      // parent (incl. BorderWindow)
+    mpRealParent                        = NULL;                      // real parent (excl. BorderWindow)
     mpFirstChild                        = NULL;                      // first child window
     mpLastChild                         = NULL;                      // last child window
     mpFirstOverlap                      = NULL;                      // first overlap window (only set in overlap windows)


More information about the Libreoffice-commits mailing list