#1149 memory leak in libpd_openfile

v0.43
open
nobody
5
2014-08-19
2014-06-28
Anonymous
No

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

2 Attachments

Discussion

  • Rich E

    Rich E - 2014-07-02

    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.

     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks