summaryrefslogtreecommitdiff
path: root/vcl/source/window
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-11-26 15:47:15 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-11-26 22:26:18 +0000
commitb3bc9d55c715f3c5357742e54a51c3116294199b (patch)
tree77911a416b878b3b3186abb8f0cc108003863de4 /vcl/source/window
parent42f5548b0e3c6c843571a2cdf58bd9a70779495e (diff)
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@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source/window')
-rw-r--r--vcl/source/window/window.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 293d735ed4c4..63951eb1cfcf 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -565,12 +565,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 );