mirror of
https://github.com/farcasclaudiu/SmartThreadPool.git
synced 2026-06-22 09:01:19 +03:00
Fixed WIG.OnIdle event bug
A null exception occurs when _onIdle is null.
This commit is contained in:
@@ -325,7 +325,7 @@ namespace Amib.Threading.Internal
|
|||||||
_stp.UnregisterWorkItemsGroup(this);
|
_stp.UnregisterWorkItemsGroup(this);
|
||||||
IsIdle = true;
|
IsIdle = true;
|
||||||
_isIdleWaitHandle.Set();
|
_isIdleWaitHandle.Set();
|
||||||
if (decrementWorkItemsInStpQueue && _onIdle.GetInvocationList().Length > 0)
|
if (decrementWorkItemsInStpQueue && _onIdle != null && _onIdle.GetInvocationList().Length > 0)
|
||||||
{
|
{
|
||||||
_stp.QueueWorkItem(new WorkItemCallback(FireOnIdle));
|
_stp.QueueWorkItem(new WorkItemCallback(FireOnIdle));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user