internal void ReleasePendingJSFunctions() { lock (pendingReleaseFuncs) { while (pendingReleaseFuncs.Count > 0) { IntPtr nativeJsFuncPtr = pendingReleaseFuncs.Dequeue(); if (!genericDelegateFactory.IsJsFunctionAlive(nativeJsFuncPtr)) { PuertsDLL.ReleaseJSFunction(isolate, nativeJsFuncPtr); } } } }
internal void ReleasePendingJSFunctions() { lock (pendingReleaseFuncs) { foreach (var nativeJsFuncPtr in pendingReleaseFuncs) { if (!genericDelegateFactory.IsJsFunctionAlive(nativeJsFuncPtr)) { PuertsDLL.ReleaseJSFunction(isolate, nativeJsFuncPtr); } } pendingReleaseFuncs.Clear(); } }
internal void ReleasePendingJSFunctions() { lock (funcRefCount) { pendingRemovedList.Clear(); foreach (var kv in funcRefCount) { if (kv.Value <= 0) { pendingRemovedList.Add(kv.Key); } } for (int i = 0; i < pendingRemovedList.Count; ++i) { var nativeJsFuncPtr = pendingRemovedList[i]; funcRefCount.Remove(nativeJsFuncPtr); if (!genericDelegateFactory.IsJsFunctionAlive(nativeJsFuncPtr)) { PuertsDLL.ReleaseJSFunction(isolate, nativeJsFuncPtr); } } pendingRemovedList.Clear(); } }