summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-04-19 01:19:59 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-20 06:13:55 +0200
commit92edd724dd7f1ca85787480f046d48f9f27c51b8 (patch)
treeb4a3ec7343cf70a22f622c99064f3beebd1f5d3d /vcl/source
parent7da637d6abe484db3dd9b008fe014f379f93b8a3 (diff)
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@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit 6827da5052bfe975a3b34af8dfa8af75d41e904c) Reviewed-on: https://gerrit.libreoffice.org/36674 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/window/window.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 50e7435eeb53..72c2a5d832e5 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -526,6 +526,7 @@ void Window::dispose()
}
delete mpWindowImpl->mpWinData;
+ mpWindowImpl->mpWinData = nullptr;
// remove BorderWindow or Frame window data
mpWindowImpl->mpBorderWindow.disposeAndClear();
@@ -552,11 +553,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