1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 16:40:26 +02:00

Fixed a shutdown crash

This commit is contained in:
Brian Fiete 2020-04-28 12:55:35 -07:00
parent 607f819d90
commit 9210346853

View file

@ -3188,7 +3188,7 @@ namespace IDE
#endif
#unwarn
if (mMainWindow == null)
if ((mMainWindow == null) || (mShuttingDown))
{
mDeferredFails.Add(new String(text));
return null;
@ -4372,7 +4372,7 @@ namespace IDE
{
if (!mInitialized)
return;
#if !CLI
mLastActivePanel = panel;
RecordHistoryLocation();
ShowTab(panel, label, false, setFocus);
@ -4380,6 +4380,7 @@ namespace IDE
panel.FocusForKeyboard();
if ((!panel.mWidgetWindow.mHasFocus) && (!mRunningTestScript))
panel.mWidgetWindow.SetForeground();
#endif
}
[IDECommand]
@ -6127,13 +6128,16 @@ namespace IDE
TabbedView.TabButton nextTab = null;
bool foundRemovedTab = false;
// Select the previous tab or the next one (if this is the first)
tabbedView.WithTabs(scope [&] (checkTab) =>
{
if (checkTab == tabButton)
foundRemovedTab = true;
else if ((!foundRemovedTab) || (nextTab == null))
nextTab = checkTab;
});
if (tabButton.mIsActive)
{
tabbedView.WithTabs(scope [&] (checkTab) =>
{
if (checkTab == tabButton)
foundRemovedTab = true;
else if ((!foundRemovedTab) || (nextTab == null))
nextTab = checkTab;
});
}
tabbedView.RemoveTab(tabButton);
if (nextTab != null)