Can't find this leak!

i see you’re calling a function called createNewPerson - does that new person you create there ever get cleaned up or deleted?

It doesn’t ever get cleaned up or deleted. At this point, I have moved away from vectors and am just initializing all of the persons in the header as an array (currently set to a length of 500). So, createNewPerson() just has one line “numPersons++;”

I’m wondering if maybe it is less of a leak, and more that the memory is just always increasing from a need to allocate more space from the calls to ofImage::grabScreen(), where the ofImage previously had not allocated an image of that size. Maybe I’m just wrong to think it would be possible for the application to be able to hold so many faces in memory?


If you are developing under XCode, I would suggest running the app under the MallocDebug utility (Run > Start with Performance Tool > Malloc Debug). After Malloc Debug starts, press the Launch button to run the app, then select “Leaks” from the drop down to check for memory leaks. Press the Update button when you want to check for leaks again.