ImageButton & memory leak

Hello

I have a Component with three ImageButton in it.
The images come from an ImageCache.

In my destructor, I put

	removeAllChildren();

but Juce reports a memory leak.
If I delete the buttons in my destructor

	removeAllChildren();
	deleteAndZero(buttonStop);
	deleteAndZero(buttonPlay1x);
	deleteAndZero(buttonPlay2x);

I don’t have any more memory leak.

Why am I forced to delete the buttons ? Isn’t it what removeAllChildren is supposed to do ?

I have another component with a slider and I don’t have to delete it using deleteAndZero, removeAllChildren handles this task.

Can you explain me ?

Thanks!

geoffroy

If you read the help comment for removeAllChildren(), it says:

[code] /** Removes all this component’s children.

    Note that this won't delete them! To do that, use deleteAllChildren() instead.
*/

[/code]

…not sure if could I have explained it any more clearly!

I’m really sorry Jules…

best

geoffroy

No problem!