[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.1' - vcl/source
Michael Meeks
michael.meeks at collabora.com
Mon May 22 08:52:11 UTC 2017
vcl/source/window/window.cxx | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
New commits:
commit 9eab735927fb4d17d77e9bc558f9e418bcde5ac9
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Apr 19 01:19:59 2017 +0100
vcl: protect Window from exceptions during construction.
Probable fix for:
http://crashreport.libreoffice.org/stats/crash_details/f69188bd-0fdd-4b74-9ec6-35b544cba0c9
Change-Id: I6442451785867f0fc2daf84776118b092d4d6a18
Reviewed-on: https://gerrit.libreoffice.org/36653
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/36676
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 63951eb1cfcf..9b55a19fb439 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -552,10 +552,12 @@ void Window::dispose()
delete mpWindowImpl->mpWinData->mpFocusRect;
delete mpWindowImpl->mpWinData->mpTrackRect;
delete mpWindowImpl->mpWinData;
+ mpWindowImpl->mpWinData = nullptr;
}
// cleanup overlap related window data
delete mpWindowImpl->mpOverlapData;
+ mpWindowImpl->mpOverlapData = nullptr;
// remove BorderWindow or Frame window data
mpWindowImpl->mpBorderWindow.disposeAndClear();
@@ -582,11 +584,16 @@ void Window::dispose()
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 );
+ if (mpWindowImpl->mpFrame) // otherwise exception during init
+ {
+ mpWindowImpl->mpFrame->SetCallback( nullptr, nullptr );
+ pSVData->mpDefInst->DestroyFrame( mpWindowImpl->mpFrame );
+ }
assert (mpWindowImpl->mpFrameData->mnFocusId == nullptr);
assert (mpWindowImpl->mpFrameData->mnMouseMoveId == nullptr);
+
delete mpWindowImpl->mpFrameData;
+ mpWindowImpl->mpFrameData = nullptr;
}
// should be the last statements
More information about the Libreoffice-commits
mailing list