[Scummvm-git-logs] scummvm master -> e31a8291ba1ad6fc0b2572e502cd6800b38ae465
eriktorbjorn
noreply at scummvm.org
Sun Sep 14 08:06:15 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
e31a8291ba TOT: Fix Valgrind free vs delete warnings
Commit: e31a8291ba1ad6fc0b2572e502cd6800b38ae465
https://github.com/scummvm/scummvm/commit/e31a8291ba1ad6fc0b2572e502cd6800b38ae465
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2025-09-14T10:05:13+02:00
Commit Message:
TOT: Fix Valgrind free vs delete warnings
Changed paths:
engines/tot/sound.cpp
engines/tot/tot.cpp
diff --git a/engines/tot/sound.cpp b/engines/tot/sound.cpp
index 02986d66eb9..ced261760dc 100644
--- a/engines/tot/sound.cpp
+++ b/engines/tot/sound.cpp
@@ -46,9 +46,9 @@ SoundManager::SoundManager(Audio::Mixer *mixer) : _mixer(mixer) {
SoundManager::~SoundManager() {
if (_midiPlayer)
delete _midiPlayer;
- free(_lastSrcStream);
- free(_audioStream);
- delete(_speaker);
+ delete _lastSrcStream;
+ delete _audioStream;
+ delete _speaker;
}
void SoundManager::init() {
diff --git a/engines/tot/tot.cpp b/engines/tot/tot.cpp
index 2977b33c96f..97dd4c44c69 100644
--- a/engines/tot/tot.cpp
+++ b/engines/tot/tot.cpp
@@ -1258,13 +1258,13 @@ void TotEngine::clearVars() {
free(_backgroundCopy);
}
if (_conversationData != nullptr) {
- free(_conversationData);
+ delete _conversationData;
}
if (_rooms != nullptr) {
- free(_rooms);
+ delete _rooms;
}
if (_sceneObjectsData != nullptr) {
- free(_sceneObjectsData);
+ delete _sceneObjectsData;
}
for (int i = 0; i < kNumScreenOverlays; i++) {
if (_screenLayers[i] != nullptr) {
More information about the Scummvm-git-logs
mailing list