Hi Andreas. I have a small question regarding the usage of script objects...let me explain my situation so you can better understand what´s going on here:
I have 3 threads. One thread (let´s call it "main") can recompile the script upon user request. The other 2 threads (let´s call them "workers") create script objects and call their methods regularly. Both workers work at their own rate and can call objects´ methods a couple of times per second or several thousand times per second. Workers will be notified when the script has been recompiled by the main thread, and they will destroy the old objects (by calling their Release() method) and create new objects based on the new version of the script. The problem is that a recompilation can occur at any time and the workers may continue to use the old objects for some time before they have the opportunity to update them.
Now, as far as I´ve been able to test, having objects created with an old version of the script (even if the script has been recompiled) causes no problem at all. I´ve even had objects created with 3 different versions of the script, all living together, even if the older objects call global functions that no longer exist in the current compiled version of the script.
Is it ok to do it this way? Does Angelscript include some magic to make all of this work, or I have just been lucky, using some kind of ghost code that might eventually get cleaned up and cause my code to finally crash?
ps: I don´t care much about serializing my objects right now.