fix: 收敛旧模块资源释放与诊断

This commit is contained in:
2026-08-15 10:13:08 +08:00
parent 222ae3c08a
commit c49015d390
60 changed files with 4218 additions and 409 deletions
+6 -2
View File
@@ -13,9 +13,13 @@
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
if (disposing)
{
components.Dispose();
ReleaseResourcesForDispose();
if (components != null)
{
components.Dispose();
}
}
base.Dispose(disposing);
}
@@ -25,6 +25,24 @@ namespace Lskj.PubModelAdd
{
InitializeComponent();
}
private void ReleaseResourcesForDispose()
{
if (mResourcesReleased)
{
return;
}
mResourcesReleased = true;
MyControl search = _leftGridSearchObj;
_leftGridSearchObj = null;
if (search != null)
{
search.OnDataSourceBindCallBack -=
OnLeftControlObjDataSourceBindCallBack;
search.Dispose();
}
}
#region
/// <summary>
/// 模块初始化完成
@@ -42,6 +60,7 @@ namespace Lskj.PubModelAdd
/// 左侧表格查询条件
/// </summary>
private MyControl _leftGridSearchObj;
private bool mResourcesReleased;
#endregion
#region
/// <summary>