Ross, >> delete[] sPropRecords; >> >> with the error that the "pointer being freed was not allocated". > > I don't understand why you're getting an error here; the code looks OK.
Yeah, I know the feeling! ;-) But it would seem more than an issue of style, it outright crashes the entire app... > FYI, in C++ "delete[]"ing (or "delete"ing) a NULL pointer is not an error (it > has no effect). Yeah...I've been wondering if I'm dealing with some compiler nuance in part. I did that to see if it would have any marked effect on the outcome. The only way I can get a run that doesn't crash is to remove the >> delete[] sPropRecords; line entirely, and as a result, the memory.... Brad On Mar 6, 2012, at 3:16 PM, Ross Finlayson wrote: >> This particular code snippet was taken directly from the Live555 >> H264VideoFileSink class implementation of its afterGettingFrame() method, so >> the exact code and usage context should be identical. >> >> Anyway, I have taken my app run it on Xcode, and this line pretty quickly >> crashes the app: >> >> delete[] sPropRecords; >> >> with the error that the "pointer being freed was not allocated". > > I don't understand why you're getting an error here; the code looks OK. > > >> I then figured that there was something internal to the >> parseSPropParameterSets which might conditionally allocate sPropRecords. So >> I wrapped the delete in a conditional: >> >> if (sPropRecords) >> { >> delete[] sPropRecords; >> } >> >> The error was the same > > FYI, in C++ "delete[]"ing (or "delete"ing) a NULL pointer is not an error (it > has no effect). > > Ross Finlayson > Live Networks, Inc. > http://www.live555.com/ > > _______________________________________________ > live-devel mailing list > live-devel@lists.live555.com > http://lists.live555.com/mailman/listinfo/live-devel
_______________________________________________ live-devel mailing list live-devel@lists.live555.com http://lists.live555.com/mailman/listinfo/live-devel