pytchlang / pytch-vm

Pytch: Core language and runtime
Other
3 stars 7 forks source link

Fix misbehaviour when unregistering original #15

Closed bennorth closed 4 years ago

bennorth commented 4 years ago

The delete_this_clone() call should be a no-op if executed by the original instance of a Sprite class. The original instance is correctly not removed from the list of live instances of a Sprite. However, the current code then always labels the Python-level object as not registered with Pytch, even if that instance is the master instance. The observable behaviour is that threads running on the original instance get unexpectedly killed. Add a test to identify this failure, and fix it.

bennorth commented 4 years ago

Thanks for looking over this. Tidied it up a bit, but the effect is the same. Will merge in a minute.