Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed ticker cleanup after timeline destroy

  • Loading branch information...
commit 991c7ae2cbb7ab1cdb91246a350d4e4776a047d9 1 parent 3534b91
@eilara authored
Showing with 8 additions and 4 deletions.
  1. +4 −2 eg/tween_demo.cpp
  2. +4 −2 src/Timeline.cpp
View
6 eg/tween_demo.cpp
@@ -72,8 +72,10 @@ void test_Timeline() { // 4 tests
ok(ticker.last_now == 1, "tick 1 now");
timeline.tick(3);
- ok(ticker.tick_count == 2, "tick 1 count");
- ok(ticker.last_now == 3, "tick 1 now");
+ ok(ticker.tick_count == 2, "tick 3 count");
+ ok(ticker.last_now == 3, "tick 3 now");
+
+ timeline.unregister_ticker(&ticker);
}
// -----------------------------------------------------------------------------
View
6 src/Timeline.cpp
@@ -11,11 +11,13 @@ typedef LinearTweenForm<int,1> LinearIntForm;
typedef LinearTweenForm<float,1> LinearFloatForm;
Timeline::Timeline() : tickers() {
- for (set<ITicker*>::iterator it = tickers.begin(); it != tickers.end(); it++)
- (*it)->stop();
}
Timeline::~Timeline() {
+ for (set<ITicker*>::iterator it = tickers.begin(); it != tickers.end(); it++) {
+ ITicker *ticker = *it;
+ ticker->stop();
+ }
}
void Timeline::register_ticker(ITicker *ticker) {
Please sign in to comment.
Something went wrong with that request. Please try again.