|
I recently discovered a bug in the way Director handles quit messages. Normally, the threading model in Director does not allow two functions to run at the same time. This bug demonstrates an exception to this rule, invalidating a fundamental principle of the Lingo processing model. Even a timeout is not able to pre-empt a function in the way that will be demonstrated shortly.
Severity
The most likely result of this bug is that on quitting your projector, the user will see a "script error" alert box. This is also likely to be intermittent. The precise effects will vary from project to project. This bug must be considered severe/critical as the effects are unpredictable and the severity of the result depends on the code that is affected.
Details
In certain circumstances, all stopMovie and endSprite events are processed during the processing of another handler. Control then returns to that handler, at the same point where it was pre-empted, despite the fact that the movie is in a state that should only be possible when it has stopped completely and no further code is to be run.
This means that if the handler that was pre-empted attempts to access objects in memory that are destroyed by either a stopMovie or endSprite handler, then those objects will no longer exist. This will cause a script error and the abnormal termination of the handler. The exact result of terminating a handler in this way is extremely difficult to predict and is impossible to test fully.
Demonstration
Download the following .dir file and create a projector to see the bug demonstrated:
Note that in current testing, the bug only seems to affect the [x] (close window) button in Windows. Other methods of quitting seem to work correctly. It has been verified in versions 8.5.1 and MX2004.
Article Information
Published: 2004.08.04
Updated: 2002.08.04
Author: Robert Tweed
|