1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed emit view cases in generics with multiple emit locations

This commit is contained in:
Brian Fiete 2022-04-16 06:55:30 -07:00
parent 2802bf87b2
commit 9000cafd73

View file

@ -6137,7 +6137,18 @@ namespace IDE.ui
}
if (emitEmbed.mView != null)
emitViewDict[emitEmbed.mTypeName] = emitEmbed.mView;
{
if (emitViewDict.TryAdd(emitEmbed.mTypeName, var keyPtr, var valuePtr))
{
*valuePtr = emitEmbed.mView;
}
else if (emitEmbed.mView.mTypeName != emitEmbed.mTypeName)
{
emitEmbed.mView.RemoveSelf();
DeleteAndNullify!(emitEmbed.mView);
ewc.mCollapseNeedsUpdate = true;
}
}
}
}
@ -6146,7 +6157,7 @@ namespace IDE.ui
if (embed.mCharData == null)
continue;
if (emitViewDict.GetValue(embed.mTypeName) case .Ok(var emitEmbedView))
if (emitViewDict.GetAndRemove(embed.mTypeName) case .Ok((var name, var emitEmbedView)))
{
var emitEmbed = emitEmbedView.mEmitEmbed;