Static SharedPtr

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)?


You can not use sharedptr in global space or as static

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

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