Don't hold Context variables for the lifetime of scheduled calls

Fixes #1568
This commit is contained in:
altrisi committed 2022-10-15 12:34:55 +02:00
1 parent 1a6febc6c0
commit 8e38619f61
2 files changed
+2 -2

No files matched your search

@@ -21,7 +21,7 @@ public class CarpetContext extends Context
} }
@Override @Override
public Context duplicate() public CarpetContext duplicate()
{ {
return new CarpetContext(this.host, this.s, this.origin); return new CarpetContext(this.host, this.s, this.origin);
} }
@@ -157,7 +157,7 @@ public class CarpetEventServer
{ {
// ignoring target as we will be always calling self // ignoring target as we will be always calling self
super(context.host.getName(), null, function, args); super(context.host.getName(), null, function, args);
this.ctx = context; this.ctx = context.duplicate();
this.dueTime = dueTime; this.dueTime = dueTime;
} }