From: Mark M. <Mar...@ds...> - 2004-10-24 20:28:09
|
<FONT face=3D"Default Sans Serif, Verdana, Arial, Helvetica, sans-serif" si= ze=3D2><DIV>Hi,</DIV><DIV> </DIV><DIV>I am using Jython from a Java pr= ogram and instantiate an InteractiveConsole to work with a GUI application.= The first time I instantiate the console, I import a module called "= crap" for argument's sake. I later trash the console, and fire up ano= ther one. The problem is - "crap" is still hanging around and is avai= lable (although somewhat stale..) in the new console. Should Jython i= t not clear out sys.modules every time? Is there a call to somehow "s= hutdown" the console I am missing? Is there some way to "initialize" = the interpreter every time to a known set of defaults? I have tried c= alling PythonInterpreter.initialize() every time I create a console but thi= s doesn't appear to do anything.</DIV><DIV> </DIV><DIV>Thanks in advan= ce,</DIV><DIV>Mark.</DIV></FONT>= |
From: Greg K. <gre...@gm...> - 2004-10-25 02:55:27
|
On Sun, 24 Oct 2004 16:27:54 -0400, Mark Melvin <mar...@ds...> wrote: > I am using Jython from a Java program and instantiate an InteractiveConsole > to work with a GUI application. The first time I instantiate the console, I > import a module called "crap" for argument's sake. I later trash the > console, and fire up another one. The problem is - "crap" is still hanging > around and is available (although somewhat stale..) in the new console. Does a call to Garbage Collection help at all? http://java.sun.com/docs/books/tutorial/java/data/garbagecollection.html http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#gc() Greg |