diff --git a/include/aolayer.h b/include/aolayer.h index 1216b32..ffbd6da 100644 --- a/include/aolayer.h +++ b/include/aolayer.h @@ -143,6 +143,9 @@ protected: // Populates the frame and delay vectors with the next frame's data. void load_next_frame(); + // used in load_next_frame + QFuture future; + signals: void done(); diff --git a/src/aolayer.cpp b/src/aolayer.cpp index 25873fe..9952494 100644 --- a/src/aolayer.cpp +++ b/src/aolayer.cpp @@ -529,8 +529,8 @@ void CharLayer::movie_ticker() void AOLayer::movie_ticker() { ++frame; - QFuture future; if (frame >= movie_frames.size() && frame < max_frames) { // need to load the image + future.waitForFinished(); // Do Not want this to be running twice future = QtConcurrent::run(this, &AOLayer::load_next_frame); } else if (frame >= max_frames) {