调用清除方法时同时调用GC

增加版本号:2.20.24.1
master
lhiven 1 year ago
parent 5e4eb1ea58
commit 0ac02d620d

@ -10,7 +10,7 @@ namespace Rs.Framework
{
public static class ImageProcess
{
static UInt64 imageNum = 0;
//static UInt64 imageNum = 0;
public static ManualResetEvent manualTriggerEvent = new ManualResetEvent(false);
public static ManualResetEvent autoTriggerEvent = new ManualResetEvent(false);
@ -19,12 +19,12 @@ namespace Rs.Framework
public static void AddManualTrigger(HObject obj)
{
imageNum++;
if (imageNum>20)
{
GC.Collect();
imageNum = 0;
}
//imageNum++;
//if (imageNum>20)
//{
// GC.Collect();
// imageNum = 0;
//}
manualTriggerList.Add(obj);
manualTriggerEvent.Set();
}
@ -33,6 +33,7 @@ namespace Rs.Framework
{
manualTriggerList.Clear();
manualTriggerEvent.Reset();
GC.Collect();
}
public static HObject GetManualImage()
@ -51,21 +52,23 @@ namespace Rs.Framework
public static void AddAutoTrigger(HObject obj)
{
imageNum++;
if (imageNum > 20)
{
LogHelper.Debug($"imagenum={imageNum},释放内存");
GC.Collect();
imageNum = 0;
}
//imageNum++;
//if (imageNum > 20)
//{
// LogHelper.Debug($"imagenum={imageNum},释放内存");
// GC.Collect();
// imageNum = 0;
//}
autoTriggerList.Add(obj);
autoTriggerEvent.Set();
}
public static void ClearAutoTrigger()
{
autoTriggerList.Clear();
autoTriggerEvent.Reset();
GC.Collect();
}
}
}

@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.20.24.1")]
//[assembly: AssemblyFileVersion("1.0.0.0")]

Loading…
Cancel
Save