millicast / millicast-player-unreal-engine-plugin

Millicast Player plugin for Unreal Engine
Other
19 stars 15 forks source link

Shutdown crash in FAudioDeviceModule #65

Closed improbable-andreaskrugersen closed 1 year ago

improbable-andreaskrugersen commented 1 year ago

Sometimes, when shutting down while a stream is still subscribed to, we see a crash in FAudioDeviceModule::Process when it's calling PullAudioData via an AsyncTask. However, in the callstack I can see that this is called from the TaskQueue.PostDelayedTask lambda further down in the same function.

Pretty sure this is garbage when this is called after the delay. This needs to be protected since it can't be guaranteed that the this pointer is still valid. Maybe pass in a weak pointer or shared pointer?

Maybe related to https://github.com/millicast/millicast-player-unreal-engine-plugin/issues/36

rweber89 commented 1 year ago

Addressed in b32651bb6e7a7dfc7e3a107ab88a7e5c2baca05f on the dev branch