Hello, I am making an iOS app with libpd 0.43.4. My app is basically a copy of the SlidePad iOS app and this "openPatchesNamed" method is lifted straight from the sample:
- (void)openPatchesNamed: (NSString *)name path: (NSString *)path instances: (int)numInstances { self.patchName = name; for (int i = 0; i < numInstances; i++) { [self.patches addObject: [PdFile openFileNamed: name path: path]]; } }
When I run the app in Apple's Instruments I see many memory leaks in libpd_openfile and libpd_close file. I've attached two screen shots which show these leaks.
For closefile, glist_delete makes calls to rtext_new which allocates memory which is never freed.
I have not debugged the openfile leak but the screen shot shows the stack trace.
My environment os OSX 10.9.3, xcode 5.1.1, on a MacBookPro
Thanks!
Allan Hoeltje
Anonymous
Howdy, Please log libpd bugs to our Github issues: https://github.com/libpd/libpd/issues?state=open
From the attached images, the leak appears to be coming deep from the internals of binbuf_evalfile, pd core's entrypoint to opening / reading a pd patch. If that's the case, it would be a pd core bug, not libpd.
Its probably worth running pd (built in debug mode with symbols) in Xcode instruments and opening the same patch, to see if the same leak occurs.