File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
src/main/java/org/piccode/rt Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -44,13 +44,22 @@ public Context() {
4444 }
4545
4646 public void resetContext () {
47- annotations .clear ();
48- threadContexts .clear ();
49- futureMap .clear ();
50- objectPool .clear ();
51- call_frames .clear ();
47+ resetContext (false );
5248 }
5349
50+ public void resetContext (boolean removeImports ) {
51+ synchronized (this ) {
52+ annotations .clear ();
53+ threadContexts .clear ();
54+ futureMap .clear ();
55+ objectPool .clear ();
56+ call_frames .clear ();
57+ if (removeImports ) {
58+ import_cache .clear ();
59+ }
60+ }
61+ }
62+
5463 public static int makeThreadContext (Context base ) {
5564 int index = threadContexts .size ();
5665 var context = new Context ();
@@ -131,7 +140,7 @@ public static Object getObject(int id) {
131140 return objectPool .get (id );
132141 }
133142 }
134-
143+
135144 public static void removeObject (int id ) {
136145 objectPool .remove (id );
137146 }
You can’t perform that action at this time.
0 commit comments