[Scummvm-git-logs] scummvm master -> 1bc5e41a5296ec6c5eeb241fcc16030aad3e1946

orgads noreply at scummvm.org
Thu May 26 10:35:09 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
1bc5e41a52 GOB: Clean up SoundDesc::free


Commit: 1bc5e41a5296ec6c5eeb241fcc16030aad3e1946
    https://github.com/scummvm/scummvm/commit/1bc5e41a5296ec6c5eeb241fcc16030aad3e1946
Author: Orgad Shaneh (orgads at gmail.com)
Date: 2022-05-26T13:34:53+03:00

Commit Message:
GOB: Clean up SoundDesc::free

Changed paths:
    engines/gob/sound/sounddesc.cpp


diff --git a/engines/gob/sound/sounddesc.cpp b/engines/gob/sound/sounddesc.cpp
index 310a2c16572..f2a02ac9777 100644
--- a/engines/gob/sound/sounddesc.cpp
+++ b/engines/gob/sound/sounddesc.cpp
@@ -114,12 +114,10 @@ bool SoundDesc::load(SoundType type, Resource *resource) {
 }
 
 void SoundDesc::free() {
-	if (_resource) {
-		delete _resource;
-		_data = nullptr;
-	}
-
-	delete[] _data;
+	if (_resource)
+		delete _resource; // _data is owned by the resource, so don't delete _data
+	else
+		delete[] _data;
 
 	_resource = nullptr;
 	_data = nullptr;




More information about the Scummvm-git-logs mailing list