summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/window/window.cxx')
-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