Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Memory leak from calling QResource::registerResource in my main() function?
Valgrindsays so ... do I have to explicitly unregister any resources which were previously registered by calling the static function
QResource::registerResource()? None of the constructors of the QResource class provide for passing a parent object, either.
It's a 'one-time' memory-leak - i.e. it's not cleaned up on application exit but it's not that big problem since the OS cleans up the memory by it's own. It's not nice but should not hurt either.
@Christian-Ehrlicher Thanks, Christian. Nevertheless, I'd like to avoid it if possible. At least I now know that "it isn't me". I'll try avoiding the static functions and see if that makes a difference.
Yes, you have to do it yourself with QResource:: unregisterResource.
Depending on how you are using your resources you could write a helper class like QMutexLocker
@SGaist Thanks ... I do call
unregisterResourcewhenever I register another one, but I need to know at the end of the
main()function which one is active. So the helper class sounds like a good idea.