Пример #1
0
        internal static void on_request_complete(IntPtr gcHandlePtr, IntPtr request, out int request_release)
        {
            var self = (CfxUrlRequestClient)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null || self.CallbacksDisabled)
            {
                request_release = 1;
                return;
            }
            var e = new CfxOnRequestCompleteEventArgs(request);

            self.m_OnRequestComplete?.Invoke(self, e);
            e.m_isInvalid   = true;
            request_release = e.m_request_wrapped == null? 1 : 0;
        }
Пример #2
0
        internal static void on_request_complete(IntPtr gcHandlePtr, IntPtr request)
        {
            var self = (CfxUrlRequestClient)System.Runtime.InteropServices.GCHandle.FromIntPtr(gcHandlePtr).Target;

            if (self == null)
            {
                return;
            }
            var e            = new CfxOnRequestCompleteEventArgs(request);
            var eventHandler = self.m_OnRequestComplete;

            if (eventHandler != null)
            {
                eventHandler(self, e);
            }
            e.m_isInvalid = true;
            if (e.m_request_wrapped == null)
            {
                CfxApi.cfx_release(e.m_request);
            }
        }