What is the best way and best place to deallocate memory in Qt? Is the destructor is a good choice to deallocate the memory?
Thanks
What is the best way and best place to deallocate memory in Qt? Is the destructor is a good choice to deallocate the memory?
Thanks
Not only in Qt - but in general:What is the best way and best place to deallocate memory in Qt?
When the allocated memory is no longer needed.
The destructor is the LAST place/time at which an object can free the momory it allocated.s the destructor is a good choice to deallocate the memory?
But you should not wait that long if any given chunk of memory is not needed any more - you should free any memory as soon as you can.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks