vlidholt/CCBReader — pull request #7 by paulmoore (2013-01-07 06:42:16+00:00)
Title: Do not run next sequence if delegate starts playing a new sequence.

If the delegate or block starts playing a new sequence, like this:

```Objective-C
- (void)completedAnimationSequenceNamed:(NSString *)name
{
if ([name isEqualToString:@"Loading"])
{
if (doneLoadingContent)
[animManager runAnimationsForSequenceNamed:@"Outro"];
}
}
```

The animation manager will cause the animation to run twice or cause a different one to play, depending on the order of the sequences and if chained sequences are used. This is because the callbacks are run first, and then the next sequence is determined and played. Because the delegate plays a new sequence, `runningSequence` refers to a new sequence, not the old one, which is then `NULL`'d.

This can be fixed by `NULL`'ing the `runningSequence` first then invoking the callbacks, and then playing the next sequence only if the delegate has not starting playing a new sequence.