Skip to content

Incorrect leaked object detection #2402

@Fusioon

Description

@Fusioon

Code to reproduce:

using System;
using System.Collections;


class Program
{
	append HashSet<int> _data = .(8);
	uint8[2048] _buffer;

	public static int Main()
	{
		let prog = new:ScopedAlloc! Program();
		while (true)
		{
			System.Threading.Thread.Sleep(1000);
		}

		return 0;
	}
}

1 object memory leak detected: mBuckets in HashSet is marked as leaked
Also when there is another append field then also mSlots becomes marked as leaked

Seems that problem is the ScopedAlloc! - when removed the code does not trigger leak detector

Tested with: Beef IDE Version 0.43.6 (Nightly 03/04/2026) Build 9448878

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions