Exemplo n.º 1
0
        private void Dispose(bool isDisposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (isDisposing)
            {
                _info.Dispose();
                _info = null;
                _requestListenersDelegates.Clear();
                _requestListenersDelegates = null;
                _indexTriggerIdToName.Clear();
                _indexTriggerIdToName = null;
                _triggerByName.Clear();
                _triggerByName = null;
            }

            //remove listener from c++
            IntPtr fnPtr = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(_requestListener);

            NativeAudioSystem.RemoveAudioRequestListener(fnPtr);
            _requestListener = null;

            _isDisposed = true;
        }
Exemplo n.º 2
0
        private void Dispose(bool isDisposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (isDisposing)
            {
                _info.Dispose();
                _info = null;
                _requestListenersDelegates.Clear();
                _requestListenersDelegates = null;
                _indexTriggerIdToName.Clear();
                _indexTriggerIdToName = null;
                _triggerByName.Clear();
                _triggerByName = null;
            }

            RemoveListener();

            _isDisposed = true;
        }