1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 22:34:09 +02:00

Fixed autocomplete panel invoke issue

This commit is contained in:
Brian Fiete 2020-06-14 08:39:52 -07:00
parent 71c020c4a1
commit ad89d4cc82

View file

@ -350,6 +350,7 @@ namespace IDE.ui
public ~this() public ~this()
{ {
Debug.Assert(mParent == null);
if (mEntryList != mFullEntryList) if (mEntryList != mFullEntryList)
delete mEntryList; delete mEntryList;
} }
@ -791,7 +792,6 @@ namespace IDE.ui
public this(AutoComplete autoComplete) public this(AutoComplete autoComplete)
: base(autoComplete) : base(autoComplete)
{ {
} }
public ~this() public ~this()
@ -1087,6 +1087,8 @@ namespace IDE.ui
//Debug.WriteLine("Autocomplete ~this {}", this); //Debug.WriteLine("Autocomplete ~this {}", this);
Close(false); Close(false);
Debug.Assert(mInvokeWidget == null);
} }
static ~this() static ~this()
@ -1736,7 +1738,20 @@ namespace IDE.ui
else else
{ {
if ((mListWindow == null) || (mListWindow.mRootWidget != mAutoCompleteListWidget)) if ((mListWindow == null) || (mListWindow.mRootWidget != mAutoCompleteListWidget))
delete mAutoCompleteListWidget; {
if (IsInPanel())
{
gApp.mAutoCompletePanel.Unbind(this);
if (mInvokeWidget != null)
{
if (mInvokeWidget.mParent != null)
mInvokeWidget.RemoveSelf();
delete mInvokeWidget;
mInvokeWidget = null;
}
}
delete mAutoCompleteListWidget;
}
if (mListWindow != null) if (mListWindow != null)
{ {
mListWindow.Close(); mListWindow.Close();
@ -2127,7 +2142,9 @@ namespace IDE.ui
} }
if (deleteSelf) if (deleteSelf)
{
BFApp.sApp.DeferDelete(this); BFApp.sApp.DeferDelete(this);
}
mClosed = true; mClosed = true;
if (mInvokeStack != null) if (mInvokeStack != null)
@ -2144,6 +2161,8 @@ namespace IDE.ui
mAutoCompleteListWidget.Cleanup(); mAutoCompleteListWidget.Cleanup();
if (mListWindow?.mRootWidget == mAutoCompleteListWidget) if (mListWindow?.mRootWidget == mAutoCompleteListWidget)
mListWindow.mRootWidget = null; mListWindow.mRootWidget = null;
if (IsInPanel())
gApp.mAutoCompletePanel.Unbind(this);
delete mAutoCompleteListWidget; delete mAutoCompleteListWidget;
} }
@ -2159,6 +2178,7 @@ namespace IDE.ui
if (mInvokeWindow?.mRootWidget == mInvokeWidget) if (mInvokeWindow?.mRootWidget == mInvokeWidget)
mInvokeWindow.mRootWidget = null; mInvokeWindow.mRootWidget = null;
delete mInvokeWidget; delete mInvokeWidget;
mInvokeWidget = null;
} }
if (mInvokeWindow != null) if (mInvokeWindow != null)
@ -2208,6 +2228,7 @@ namespace IDE.ui
delete mInvokeWidget; delete mInvokeWidget;
mInvokeWidget = mInvokeStack[mInvokeStack.Count - 1]; mInvokeWidget = mInvokeStack[mInvokeStack.Count - 1];
mInvokeStack.RemoveAt(mInvokeStack.Count - 1); mInvokeStack.RemoveAt(mInvokeStack.Count - 1);
UpdateAsyncInfo(); UpdateAsyncInfo();
return; return;
} }