1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added an advisory note about deleteAllChildren()

This commit is contained in:
jules 2014-12-29 12:02:35 +00:00
parent d31d02b4e8
commit 04cb9bf3e8

View file

@ -775,7 +775,13 @@ public:
*/
void removeAllChildren();
/** Removes all this component's children, and deletes them.
/** Removes and deletes all of this component's children.
My advice is to avoid this method! It's an old function that is only kept here for
backwards-compatibility with legacy code, and should be viewed with extreme
suspicion by anyone attempting to write modern C++. In almost all cases, it's much
smarter to manage the lifetimes of your child components via modern RAII techniques
such as simply making them member variables, or using ScopedPointer, OwnedArray, etc
to manage their lifetimes appropriately.
@see removeAllChildren
*/
void deleteAllChildren();