adlnet-archive / scorm4unity

The Unity-SCORM Integration Toolkit is a demonstration of how content developers can use a game engine to create SCORM-Conformant content.
34 stars 17 forks source link

Threading issues #6

Closed rchadwic closed 12 years ago

rchadwic commented 12 years ago

So we've found a subtle but important bug. The callback "Scorm_Initialization_Complete" call runs within the thread that is spawned by the ScormManager. This limits the code that you can run in this handler. Unfortunately, there is not documentation that mentions this, so it's totally possible that someone out there is running non-thread safe functions, with no knowledge that their code is running in a thread that is not the main Unity script thread. This might not be a problem for many people who might be setting a flag or something, but if you are doing more scene setup on this event, you can have strange problems. We need to find a way to get that callback to run in the main Unity script thread, not in the thread spawned for the deserialization.

stevenvergenz commented 12 years ago

Opened branch "fix-issue6" to handle issue.

stevenvergenz commented 12 years ago

The thread scoping has been resolved. All events should now be throwing in the main Unity thread as of commit 74d7785d03.