Closed Bug 51445 Opened 25 years ago Closed 25 years ago

[MLK] Leaking NSPR locks & condition variables

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: beard, Assigned: dougt)

References

()

Details

(Keywords: embed, Whiteboard: [nsbeta3+])

We are allocating PLEvent structs and calling PL_InitEvent() on them at the URL above. However, the code that deallocates the event, nsProxyObjectCallInfo::~nsProxyObjectCallInfo(), and elsewhere in nsProxyEvent.cpp, is not calling PL_DestroyEvent() which deallocates any NSPR locks/condition variables.
Status: NEW → ASSIGNED
Keywords: embed, nsbeta3
Actually, posting the event will call PL_DestroyEvent. The leak is caused because of an optimization I made to directly call the plevent handler: Can you verify that this fixes the problem? Index: nsProxyEvent.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/proxy/src/nsProxyEvent.cpp,v retrieving revision 1.58 diff -c -r1.58 nsProxyEvent.cpp *** nsProxyEvent.cpp 2000/08/28 23:23:32 1.58 --- nsProxyEvent.cpp 2000/09/06 02:39:30 *************** *** 446,452 **** if (callDirectly) { ! EventHandler(event); // there is no need to call the DestroyHandler() because // there is no need to wake up the nested event loop. } --- 446,453 ---- if (callDirectly) { ! EventHandler(event); ! PL_DestroyEvent(event); // there is no need to call the DestroyHandler() because // there is no need to wake up the nested event loop. }
Keywords: patch
One more observation, the call to PL_InitEvent() on line 437 of nsProxyEvent.cpp could fail, but the result code is being ignored. Trying out your patch.
Updating QA Contact...dougt, you will need to verify when fixed please
Keywords: verifyme
QA Contact: leger → dougt
Patch fixes leak.
kill it!
Whiteboard: [nsbeta3+]
Thanks for finding this Patrick. Fix checked in. [dougt@z src]$ cvs commit cvs commit: Examining . ? proxyChange Checking in nsProxyEvent.cpp; /cvsroot/mozilla/xpcom/proxy/src/nsProxyEvent.cpp,v <-- nsProxyEvent.cpp new revision: 1.59; previous revision: 1.58 done
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
mass remove verifyme requests greater than 4 months old
Keywords: verifyme
You need to log in before you can comment on or make changes to this bug.