Describe the bug
m_pLuaManager is used before it's defined @ CGame.cpp:514
Expected behaviour
m_pLuaManager should be assigned a valid value before usage
Additional context
The pointer isn't used anywhere in the classes its passed into, but if it does it'll cause some nice headache.
Just leaving this issue here, so I dont forget about fixing it (Im lazy to commit my changes on another branch)
If it's not being used perhaps it should just be removed?
Every pointer-in-the-class to a manager should be removed IMHO, especially where the manager is a non static member.. waste of memory. The compiler is smart enough to inline the [get
Depending on globals are bad though
Yeah um btw, we could use singletons, as all managers are basically singletons.
That way we only need to static init them in the main manager.
Thats as close as we'll get to a clean setup.
Making classes static (aka no singleton) is a worse idea imho, as that way I dont think its guaranteed for all static members to be in the memory after each other (like when you allocate the class on the heap). So in terms of CPU cache that would suck
Most helpful comment
If it's not being used perhaps it should just be removed?