[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - vcl/source
Michael Meeks
michael.meeks at collabora.com
Mon Nov 28 11:39:59 UTC 2016
vcl/source/window/window.cxx | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
New commits:
commit 6c8bfac5329741530f7cb2740246dbd11449fb74
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Sat Nov 26 15:47:15 2016 +0000
tdf#101327 - tolerate exceptions during window construction better.
It appears we can end up being a frame window, which is not added
into the list of frames; so tolerate that.
Change-Id: I7696e79636f7794f327027f0ca73363eef1937e5
Reviewed-on: https://gerrit.libreoffice.org/31235
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Michael Meeks <michael.meeks at collabora.com>
(cherry picked from commit 115671bf929a82709c535b475bf19f4967a666c8)
Reviewed-on: https://gerrit.libreoffice.org/31254
Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
Tested-by: Julien Nabet <serval2412 at yahoo.fr>
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 9170c6b..ac89e1c 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -535,12 +535,22 @@ void Window::dispose()
pSVData->maWinData.mpFirstFrame = mpWindowImpl->mpFrameData->mpNextFrame;
else
{
+ sal_Int32 nWindows = 0;
vcl::Window* pSysWin = pSVData->maWinData.mpFirstFrame;
- while ( pSysWin->mpWindowImpl->mpFrameData->mpNextFrame.get() != this )
+ while ( pSysWin && pSysWin->mpWindowImpl->mpFrameData->mpNextFrame.get() != this )
+ {
pSysWin = pSysWin->mpWindowImpl->mpFrameData->mpNextFrame;
+ nWindows++;
+ }
- assert (mpWindowImpl->mpFrameData->mpNextFrame.get() != pSysWin);
- pSysWin->mpWindowImpl->mpFrameData->mpNextFrame = mpWindowImpl->mpFrameData->mpNextFrame;
+ if ( pSysWin )
+ {
+ assert (mpWindowImpl->mpFrameData->mpNextFrame.get() != pSysWin);
+ pSysWin->mpWindowImpl->mpFrameData->mpNextFrame = mpWindowImpl->mpFrameData->mpNextFrame;
+ }
+ else // if it is not in the list, we can't remove it.
+ SAL_WARN("vcl", "Window " << this << " marked as frame window, "
+ "is missing from list of " << nWindows << " frames");
}
mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr );
pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame );
More information about the Libreoffice-commits
mailing list