Open lolzballs opened 9 years ago
On further inspection, various widgets in AddGameWizard need parents as well.
Noted, will amend in the refactor inbound. Muchas gracias, senor.
Just curious about design decisions, why aren't managed pointers such as unique_ptr<T>
and shared_ptr<T>
being used? I don't see the reason behind using raw pointers in 2015 unless one is working with legacy code. In terms of performance, compilers can optimize unique_ptr
s to the same machine code as raw pointers.
If it's just a matter of somebody doing it, let me know.
Sent from my Android device with K-9 Mail. Please excuse my brevity.
To elaborate on the response by @elken above, Qt by nature favors heap-allocation of local QObjects for a number of reasons, opting to manage memory hierarchically throughout the application when respective QObjects are parented to one another. In this issue, some parents were never set, hence the memory leakage.
The sheer amount of QObjects we're initializing programmatically now and in the future favors raw pointers as a form of brevity, though yes, in any other case we would be doing otherwise.
To further elaborate, we also want raw pointers as arguments and as local variables for the speed and leanness of just an address, we don't need the overhead *_ptr
types provide.
Issue seems to be resolved, reopen if not.
The memory leak still occurs on both wizards: http://i.imgur.com/Jd5Ztm0.gifv
The pages in AddGameWizard are not having a parent set, causing a memory leak. As well, the onAddGameClicked() in Library is not setting itself as a parent, and is creating a memory leak as well.
this
cannot be set as a parent as it leads to inheritance of the Library stylesheet.