Steam Audio

@dyanikoglu
I can’t test it deeply right now, but this should fix it:

PhononPluginManager.cpp



    void FPhononPluginManager::OnListenerShutdown(FAudioDevice* AudioDevice)
    {
        // Shutdown reverb effect
        if (IsUsingSteamAudioPlugin(EAudioPlugin::REVERB))
        {
            ReverbPtr = static_cast<FPhononReverb*>(AudioDevice->ReverbPluginInterface.Get());
            ReverbPtr->DestroyReverbEffect();
            ReverbPtr->Shutdown();
        }

        FSteamAudioModule* Module = &FModuleManager::GetModuleChecked<FSteamAudioModule>("SteamAudio");
        if (Module != nullptr)
        {
            Module->UnregisterAudioDevice(AudioDevice);
        }
    }


PhononReverb.cpp



    void FPhononReverb::Shutdown()
    {
        for (auto& ReverbSource : ReverbSources)
        {
            if (ReverbSource.ConvolutionEffect)
            {
                iplDestroyConvolutionEffect(&ReverbSource.ConvolutionEffect);
            }
        }

        if (ReverbConvolutionEffect)
        {
            iplDestroyConvolutionEffect(&ReverbConvolutionEffect);
        }

        if (IndirectBinauralEffect)
        {
            iplDestroyAmbisonicsBinauralEffect(&IndirectBinauralEffect);
        }

        if (IndirectPanningEffect)
        {
            iplDestroyAmbisonicsPanningEffect(&IndirectPanningEffect);
        }

        if (BinauralRenderer)
        {
            iplDestroyBinauralRenderer(&BinauralRenderer);
        }

        if (IndirectOutDeinterleaved)
        {
            for (int32 i = 0; i < AmbisonicsChannels; ++i)
            {
                delete] IndirectOutDeinterleaved*;
            }
            delete] IndirectOutDeinterleaved;
            IndirectOutDeinterleaved = nullptr;
        }

        Environment = nullptr;
    }

    void FPhononReverb::DestroyReverbEffect()
    {
        for (FReverbSource& ReverbSource : ReverbSources)
        {
            if (ReverbSource.ConvolutionEffect)
            {
                iplDestroyConvolutionEffect(&ReverbSource.ConvolutionEffect);
            }
        }
    }


And to be safe:



    void FPhononReverb::SetEnvironment(FEnvironment* InEnvironment)
    {
        if (!InEnvironment)
        {
            return;
        }

        // Free currently existing environment
        if (Environment)
        {
            // Shutdown all
            DestroyReverbEffect();
            Shutdown();
        }

        ...
    }