Closing scene with active (Playing or Paused) webcamTexture crashes on Android, with Error Fatal signal 11 (SIGSEGV)
Tested on Samsung Galaxy 3
Android version: 4.4.2
Unity 5.2.2.
To ‘fix’ the problem I first call Stop(); then Destroy (with breaks in between). I spent a few hours on this to figure it out. This is my script, hopefully it helps someone.
For me WebCamTexture was crashing whenever i call the function ‘Stop()’. It was really frustrating. I didn’t really found a solution but i’ve found that this issue/bug is resolved in Unity 2017.1.0f3. It doesn’t crash at all in that version, so i’d recommend moving to 2017.
This very same bug (or very similar) is back in 2018.2.0f2
Luckily the workaround seems to work here as well; no need to actively destroy the webcamTexture, just waiting a fraction of a second seems to be enough.
Reported as bug:
What happened
A webcam picture is displayed on a rawImage texture.
The managing script stops the webcam picture in both an OnDisable and OnDestroy handler
When switching to another scene using the SceneManager the app crashes on Andoid
This can be prevented by waiting a short time between stopping the Webcam playback and swicthing to the new scene.