toolness / pathfinder-unity-fun

Attempting to build a Unity native plugin for Pathfinder's Canvas API.
5 stars 1 forks source link

Switch to other GL contexts during shutdown. #6

Closed toolness closed 5 years ago

toolness commented 5 years ago

This is a PR against #5. This builds upon the work done in #5.

This is an attempt to switch to other GL contexts when Unity asks Pathfinder to release its resources. It seems to work but it feels really risky so I'm not sure if I'm going to merge it.

toolness commented 5 years ago

So this seems stable and also seems to stop the Unity editor from crashing while in play mode, as far as I can tell. I also found out that we can successfully shutdown all renderers when Unity sends its graphics shutdown event, which feels right. I guess I will go ahead and merge this since it feels less weird than spamming the shutdown event in hopes that we'll eventually cover all the GL contexts.