fix: 收敛旧模块资源释放与诊断
This commit is contained in:
+6
-2
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user