FilePreviewComponent leaks memory


#1

Hi Jules,

in the current tip (hopefully; I did a “git stash” and “git pull” which should get the current tip as far as I understand) a component that’s based on FileChooserPreview seems to leak memory:

*** Leaked objects detected: 1 instance(s) of class StringArray
JuceDemo.exe hat einen Haltepunkt ausgelöst.
*** Leaked objects detected: 1 instance(s) of class HeapBlock
JuceDemo.exe hat einen Haltepunkt ausgelöst.

This happens for example in the JuceDemo when you use “‘Load’ file browser with an image preview”.

It doesn’t leak that much, but it’s annoying that the debbuger breaks every time you quit.
I’m using Visual Studio 2008 Express if that’s relevant.

Chris


#2

There’s no such class as “FileChooserPreview”… (?)


#3

My wrong. I meant FilePreviewComponent. I also changed the title.

Edit: But it seems, the changed title doesn’t show in the threads overview. :frowning:

Chris


#4

I fixed the title for you.


#5

Please check that you’re on the very latest modules branch - the last date in your “git log” should be this week.


#6

I just updated to the latest tip which is confirmed by ‘git log’ (Thu Jan 26). The leak still occurs as soon as a FilePreviewComponent is given to a FileChooser object.
If line 1347 in WidgetsDemo.cpp (JuceDemo) is changed to

if (fc.browseForMultipleFilesToOpen ())

the assertion in LeakCounter isn’t hit.

Could you put the ‘git log’ in the reporting bugs sticky?

Chris


#7

Hmm, seems like this was a really obscure win32 COM ref-count thing. Not worth worrying about, but I’ll tidy it up in my next check-in.


#8

Great, thanks.

Chris