Static SharedPtr


#1

When using static SharedPtr classmembers, my game crashes upon exiting when the destroyed object tries to remove itself from the list of event senders in the (already destroyed) context. What is a good way to avoid this? Just don’t use static objects (it is probably relatively easy now that the context has the global variables)?

Thanks!


#2

You can not use sharedptr in global space or as static https://github.com/urho3d/Urho3D/issues/802

For global objects you can create own sybsystem and store objects in it


#3

Actually, you can. But it’s pretty dirty and you have to release this pointer maunally before context destruction.