1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix access to CPrologEpilogVideo after destruction from sound callback

This commit is contained in:
Ivan Savenko
2024-04-11 13:22:06 +03:00
parent c7fda0dc32
commit 9188280d02
3 changed files with 9 additions and 0 deletions

View File

@@ -74,6 +74,7 @@ void CPrologEpilogVideo::show(Canvas & to)
void CPrologEpilogVideo::clickPressed(const Point & cursorPosition)
{
close();
CCS->soundh->resetCallback(voiceSoundHandle); // reset callback to avoid memory corruption since 'this' will be destroyed
CCS->soundh->stopSound(voiceSoundHandle);
CCS->soundh->stopSound(videoSoundHandle);
if(exitCb)