protected virtual void Dispose(bool disposing)
    {
        if (_disposed)
        {
            return;
        }

        if (disposing)
        {
        }

        if (_handle != null)
        {
            if (
                !_handle.IsInvalid &&
                !_handle.IsClosed
                )
            {
                _logger.LogInformation("[wave] stop");
                Reset();

                //バッファの開放待ち
                _logger.LogInformation($"[wave] wait busy buffers :{_headerBusyPool.Count}");
                while (_headerBusyPool.Count > 0)
                {
                    Thread.Sleep(1000);
                    _logger.LogInformation($"[wave] wait busy buffers :{_headerBusyPool.Count}");
                }
                _logger.LogInformation($"[wave] wait end :{_headerBusyPool.Count}");

                _releaseAction.Complete();
                _releaseAction.Completion.Wait();

                _handle.Close();
            }
        }

        _headerPool?.Dispose();
        _driverCallBack?.Dispose();

        _disposed = true;
    }
예제 #2
0
    protected virtual void Dispose(bool disposing)
    {
        if (_disposed)
        {
            return;
        }

        if (disposing)
        {
            _logger.LogInformation("[vst] stop");

            CloseAsync().Wait();
            _audioMaster.EffectMap.Remove(_aeffectPtr);

            _audioMasterCallBack?.Dispose();
            _events?.Dispose();
            _eventList?.Dispose();
        }

        _disposed = true;
    }