summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-11-26 15:47:15 +0000
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-28 11:24:52 +0000
commit77b65e3e7ae04f6f00f2cadda9fd80176fe0dec1 (patch)
treec1481a43c757dcd1909fee496c95a4c9bfc08fb6
parent0b11455e1905b9a7ce3958ea43bbfe5cbb6ee916 (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> (cherry picked from commit 115671bf929a82709c535b475bf19f4967a666c8) Reviewed-on: https://gerrit.libreoffice.org/31255 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-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 f00022ef2ec6..472b0f67c403 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -539,12 +539,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 );