wait for thread to finish before starting new one
This commit is contained in:
		
							parent
							
								
									42760bc3f8
								
							
						
					
					
						commit
						2a18c1cdec
					
				@ -143,6 +143,9 @@ protected:
 | 
				
			|||||||
  // Populates the frame and delay vectors with the next frame's data.
 | 
					  // Populates the frame and delay vectors with the next frame's data.
 | 
				
			||||||
  void load_next_frame();
 | 
					  void load_next_frame();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // used in load_next_frame
 | 
				
			||||||
 | 
					  QFuture<void> future;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
signals:
 | 
					signals:
 | 
				
			||||||
  void done();
 | 
					  void done();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -529,8 +529,8 @@ void CharLayer::movie_ticker()
 | 
				
			|||||||
void AOLayer::movie_ticker()
 | 
					void AOLayer::movie_ticker()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  ++frame;
 | 
					  ++frame;
 | 
				
			||||||
  QFuture<void> future;
 | 
					 | 
				
			||||||
  if (frame >= movie_frames.size() && frame < max_frames) { // need to load the image
 | 
					  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);
 | 
					      future = QtConcurrent::run(this, &AOLayer::load_next_frame);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else if (frame >= max_frames) {
 | 
					  else if (frame >= max_frames) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user