I’m using a custom Label component for my ListBox because I want to be able to double-click the ListBox items and rename them. Everything is working, except that I’m getting memory leaks from the ListBoxModel::refreshComponentForRow(int row, bool selected, Component* existingComponent) method.
Here’s my code:
So basically, if the method provides nullptr I create a new object, and if not I alter the provided component’s properties and return it. Am I missing something? For some reason, if I add more rows past the 11th row it starts leaking. I assume it has to do with the fact that my ListBox is only tall enough to display 11 rows at once.
I’m not really sure where this is coming from, and stepping through the code hasn’t revealed anything so far.
I figure that I might be going about this the wrong way.