aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCrystalwarrior <Varsash@Gmail.com>2022-05-21 17:17:24 +0300
committerGitHub <noreply@github.com>2022-05-21 16:17:24 +0200
commit8657f7c2a2fbcbce52b744de50159ac5cdcc0ae8 (patch)
tree0575ed8cbc275274d56db8915f8fafd1e2ba063e /src
parenta1edef048f2cef816106c0fb89b8764e7f715cc4 (diff)
Fix a segfault caused by animated desks and switching to area without a desk (#718)
* Fix a segfault caused by animated desks because aolayer did not make sure that movie_delays is not empty This happened because kill() did not actually reset the max_frames. Fix that too. * do the thingy longbyte said
Diffstat (limited to 'src')
-rw-r--r--src/aolayer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/aolayer.cpp b/src/aolayer.cpp
index ba7f2cb4..badf6351 100644
--- a/src/aolayer.cpp
+++ b/src/aolayer.cpp
@@ -383,9 +383,9 @@ void AOLayer::play()
this->freeze();
}
else {
- while (movie_delays.size() <= frame) {
- frameAdded.wait(&mutex);
- }
+ while (movie_delays.size() <= frame) {
+ frameAdded.wait(&mutex);
+ }
ticker->start(this->get_frame_delay(movie_delays[frame]));
}
}
@@ -531,6 +531,8 @@ void AOLayer::kill()
this->clear();
movie_frames.clear();
movie_delays.clear();
+ last_max_frames = max_frames;
+ max_frames = 0;
last_path = "";
}