fix(winforms): release module grid resources

This commit is contained in:
2026-08-26 01:10:27 +08:00
parent 6cde5df2f2
commit 1e06682a12
8 changed files with 491 additions and 85 deletions
+14 -1
View File
@@ -154,7 +154,11 @@ namespace Lskj.PubModuleDetail
{
this.mControl.CloseModule();
string guid = this.Tag + "";
if (string.IsNullOrWhiteSpace(guid)) return;
if (string.IsNullOrWhiteSpace(guid))
{
this.mControl.ReleaseResourcesForDispose();
return;
}
DllModule m = Manager.ModuleForms[guid];
m.IsClose = true;
if (SystemInfo.Instance.EfficientVerification)
@@ -175,6 +179,15 @@ namespace Lskj.PubModuleDetail
}
}
}
// FormClosing fires before the control tree is disposed. Release the
// DevExpress grids and their native resources as soon as the close is
// confirmed; waiting for FrmMain.Dispose leaves GDI handles alive
// between module cycles.
if (!e.Cancel)
{
this.mControl.ReleaseResourcesForDispose();
}
}
/// <summary>