cs-util-com / cscore

cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
https://cs-util-com.github.io/cscore/
Apache License 2.0
195 stars 32 forks source link

Some objects were not cleaned up when closing the scene (on scene start) #51

Closed spvn closed 2 years ago

spvn commented 3 years ago

I'm getting the following error every time I start a scene (including the included demo scenes) with cscore imported:

Some objects were not cleaned up when closing the scene. (Did you spawn new GameObjects from OnDestroy?)
The following scene GameObjects were found:
Singletons
com.csutil.MainThread

Any ideas why? Interestingly I'm getting this when STARTING the scene, not stopping it.

cs-util commented 3 years ago

@spvn yes I noticed this warning too a while back and changed a few things about the initialization of the MainThread Singleton that happens in the UnitySetup.cs

On the latest master branch this warning should not happen anymore, can you try this by copying the latest code from this repo into your project (I did not update the Unity Store yet)?