For the record, the solution proposed in this article works (albeit a bit risky). However, the leak also disappears if you open and close another child form, it seems that the MDI parent only leaks the last child opened.
If you want to fix the leak using the work specified in the link, just override the MDMarent OnMdiChildActivate method ...
protected override void OnMdiChildActivate(EventArgs e) { base.OnMdiChildActivate(e); typeof(Form).InvokeMember("FormerlyActiveMdiChild", BindingFlags.Instance | BindingFlags.SetProperty | BindingFlags.NonPublic, null, this, new object[] { null }); }
Jeremy jarrell
source share