Skip to content

Commit

Permalink
remove load java & tjc, assorted auto_* commands when creating safe i…
Browse files Browse the repository at this point in the history
…nterps

avoid leaking reflected java objects (patch from Aejaks)
  • Loading branch information
tpoindex committed Sep 21, 2012
1 parent bf9aaad commit 76fd12d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/tcl/lang/Interp.java
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ public class Interp extends EventuallyFreed {
// List of unsafe commands:

static final String[] unsafeCmds = { "encoding", "exit", "load", "cd", "fconfigure", "file", "glob", "open", "pwd",
"socket", "beep", "echo", "ls", "resource", "source", "exec", "source" };
"socket", "beep", "echo", "ls", "resource", "source", "exec", "jaclloadjava", "jaclloadtjc",
"auto_execok", "auto_import", "auto_load", "auto_load_index", "auto_qualify"};

// Flags controlling the call of invoke.

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/tcl/pkg/java/ReflectObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ else if (cl == Void.TYPE)

ReflectObject roRep = findInReflectTable(interp, cl, obj);

if (roRep != null) {
if (roRep != null && roRep.isValid) {
// If it is already in the table just increment the use count and
// return it

Expand Down Expand Up @@ -931,6 +931,7 @@ public void disposeCmd() {
}

isValid = false;
dispose();
}

/*
Expand Down

0 comments on commit 76fd12d

Please sign in to comment.