C#C
C#β€’8mo ago
Olsson

Hitting a breakpoint in a async task causes my AssemblyLoadContexts to not unload

Hi, I have this method:

async void UpdateVisuals()
    {
        try
        {
            Txt_Title.Text = _tableData.Title;
            Img_Icon.SetBrushFromSoftTexture(_tableData.UIIcon);
        
            InteractableClass = await _tableData.TargetClass.LoadAsync();
            BG.BrushColor = MathLibrary.Conv_ColorToLinearColor(_tableData.TabColor);
        }
        catch (Exception e)
        {
            LogCropout.Log(e.Message);
        }
    }


Whenever I I place a breakpoint after the await, it fails to unload the AssemblyLoadContext on next hot reload that this method is in. It's like the debugger keeps a hard reference around. Any tips on how to debug this? πŸ˜„

Everything I allocate in the async is confirmed to be disposed. I just allocate a weak reference to a delegate for a callback
Was this page helpful?