Archive 17/01/2023.

Static SharedPtr

SirNate0

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!

1vanK

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

Eugene

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