diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-13 22:20:44 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 11:02:38 +0100 |
commit | 06f4760e3451601b3f43a72c4f1c5c4233c3f61a (patch) | |
tree | 03ba7b789a0fcd7b497d99f42290d46e9b0cef0b | |
parent | 00ebfa7b1f3086e729b7a088d690cb5eda2a820e (diff) |
add some more helpful paranoia to disposeOnce.
Change-Id: I46f2bf5115f2b80990fdcac75bd31615c4221b9e
-rw-r--r-- | vcl/source/window/window.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 6ee6dc001d3f..d2177e44ce34 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -142,6 +142,13 @@ void Window::disposeOnce() if (!mpWindowImpl || mpWindowImpl->mbInDispose) return; mpWindowImpl->mbInDispose = true; + + // catch badness where our Window was not wrapped safely + // in a VclPtr cosily. + assert( mnRefCnt>0 ); + + // hold a ref in case something silly happens during dispose. + VclPtr<Window> aRef(this); dispose(); } |