Memory leak: ComboBox in a CallOutBox


#1

Hi Jules,

My code leaks a TypefaceCache when:

  1. I have a ComboBox embedded in an asynchronous CallOutBox
  2. The application exits before the CallOutBox has been dismissed

CallOutBox::launchAsynchronously(new ComboBox, getScreenBounds(), nullptr);

I am on OS X 10.10.


#2

Well, if you don’t delete the CallOutBox and leave it running during shutdown, then it could leak all kinds of things.

If you’re firing off callout boxes like this then you probably want to do something like the Projucer does in its shutdown code, where it makes sure that any active modal windows have been closed before quitting.


#3

Thanks for pointing me to the shutdown code in the Projucer. That worked. Thanks Jules!