Fixed by Edward:
I've checked in a change that I hope fixes the problem we were
chasing today. The cause is interesting...
When we edit a model, the editor constructs a MoML string for
the edit actions. E.g., to remove a Display actor, it says:
<deleteEntity name="Display"/>
It passes this string to a MoMLChangeRequest, and calls
requestChange() to request that the change be executed.
If the model is not running, then the change request will
be executed immediately within the requestChange() method.
However, executing a change request may result in additional
changes being requested... E.g., an additional change may
be requested to remove a relation.
Before my checkin, that second change request was NOT being
executed immediately. It would just sit in a queue until
it was time execute another change request (e.g., move an
actor).
The new code in NamedObj is now also simpler:
public void requestChange(ChangeRequest change) {
NamedObj container = getContainer();
if (container != null) {
container.requestChange(change);
} else {
// Synchronize to make sure we don't modify
// the list of change requests while some other
// thread is also trying to read or modify it.
synchronized (_changeLock) {
// Queue the request.
// Create the list of requests if it doesn't already exist
if (_changeRequests == null) {
_changeRequests = new LinkedList<ChangeRequest>();
}
_changeRequests.add(change);
}
if (!_deferChangeRequests) {
executeChangeRequests();
}
}
}