TQPathManager: memory leak?
Hey,
I need help from more experienced c++ programmers. In TQPathManager, there is the following line initializing the static instance of the path manager:
TQPathManager TQPathManager::gPathManager = *(new TQPathManager());
I am not sure if this line causes a memory leak. It creates an instance of the path manager on the right-hand side. What exactly does the "=" sign do? Does it assign this instance to gPathManager or does it copy the instance to gPathManager (thus creating another instance).
I have tried the following line instead (the syntax is taken from the implementation in TQLibrary), but it causes another issue, because the destructor is not called automatically when the framework ends.
TQPathManager* TQPathManager::gPathManager(new TQPathManager());