re PR libgcj/12475 (Stack traces leak memory)

Fix PR libgcj/12475
	* gnu/gcj/runtime/StackTrace.java (finalize): Declare.
	* gnu/gcj/runtime/natStackTrace.cc (finalize): New. Free "addrs".

From-SVN: r72012
This commit is contained in:
Bryce McKinlay 2003-10-02 07:10:34 +00:00 committed by Bryce McKinlay
parent f4b2bde73f
commit fddb33d2cd
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2003-10-01 Bryce McKinlay <bryce@mckinlay.net.nz>
Fix PR libgcj/12475
* gnu/gcj/runtime/StackTrace.java (finalize): Declare.
* gnu/gcj/runtime/natStackTrace.cc (finalize): New. Free "addrs".
2003-10-01 Tom Tromey <tromey@redhat.com>
* gnu/gcj/runtime/FirstThread.java (getMain): Fixed indentation.

View file

@ -157,6 +157,7 @@ public final class StackTrace
}
private native void fillInStackTrace(int n, int offset);
protected native void finalize();
private static native MethodRef getCompiledMethodRef(RawData addr);
private static IdentityHashMap map = new IdentityHashMap();

View file

@ -200,4 +200,9 @@ gnu::gcj::runtime::StackTrace::update(void)
}
}
void
gnu::gcj::runtime::StackTrace::finalize(void)
{
if (addrs != NULL)
_Jv_Free (addrs);
}