Every buffer that gets allocated in ns4xPluginStreamListener::OnDataAvailable() leaks. When testing the cache with the Quicktime plugin on the Mac, this generated a HUGE memory leak as it displayed a Quicktime movie. I have a patch, and this should probably go in to Mozilla 0.8.1, IMHO.
Created attachment 27735 [details] [diff] [review] Fix for memory leak and some additional error handling.
Target Milestone: --- → mozilla0.8.1
Some comments on the patch: * maybe you should switch from PR_Free() to nsCRT::free() and PR_Malloc to nsCRT::malloc()? * please avoid goto's if possible otherwise the patch looks good to me.
The goto is legitimate, to implement a common exit point for early returns. If we had a generic class for managing dynamically allocated buffers, this could be used and early returns wouldn't require a goto. I was interested in creating a minimal patch.
Personally, I'd use nsMemory instead of nsCRT. What it comes down to is we have too many ways to manipulate memory (IMO). And yes, breaks could be used instead of gotos, but the final code will be essentially the same. The patch is solid and a distinct improvement over the rather severe leakage currently happening. r=bnesse.
lets do it as soon as leaf is ready for checkin's
Whiteboard: have patch ready for 0.8.1
let's get this checked in a=asa (on behalf of drivers)
So, who's checking this in to the trunk? Am I?
I've done this. Marking fixed.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.