Closed Bug 45415 Opened 24 years ago Closed 24 years ago

[MLK] LiveConnect leaks JSJHashtable java_class_reflections

Categories

(Core Graveyard :: Java: Live Connect, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: beard, Assigned: rogerl)

References

()

Details

(Keywords: memory-leak, Whiteboard: [nsbeta3+])

See the blame URL above, when jsj_InitJavaClassReflectionsTable() gets called 
multiple times, it overwrites java_class_reflections. Here's a patch to fix it:

Index: mozilla/js/src/liveconnect/jsj_class.c
===================================================================
RCS file: /cvsroot/mozilla/js/src/liveconnect/jsj_class.c,v
retrieving revision 1.13
diff -b -c -2 -r1.13 jsj_class.c
*** jsj_class.c	2000/06/23 02:28:05	1.13
--- jsj_class.c	2000/07/13 20:54:11
***************
*** 726,729 ****
--- 726,730 ----
  jsj_InitJavaClassReflectionsTable()
  {
+     if (!java_class_reflections) {
          java_class_reflections =
              JSJ_NewHashTable(64, jsj_HashJavaObject, jsj_JavaObjectComparator,
***************
*** 744,747 ****
--- 745,749 ----
              return JS_FALSE;
  #endif
+     }
      
      return JS_TRUE;
[SPAM] Bug triage for nsbeta3
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Nominating for nsbeta3 and clearing Future milestone for reevaluation.  This
should be fix because:
 1) It's a real leak
 2) It adds a good bit of noise to leak reports
 3) There's a trivial patch attached (which may or may not be right)
 4) There could be other bugs caused by this code.
Keywords: nsbeta3
Target Milestone: Future → ---
Low risk fix.
Whiteboard: [nsbeta3+]
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verifying -
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.