[Scummvm-git-logs] scummvm master -> bb73c6199986f664b96b6768cfb73a795c2b8321

criezy criezy at scummvm.org
Thu Oct 29 20:47:57 UTC 2020


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:
bb73c61999 COMMIT: Add missing destruction of elements when downsizing an Array


Commit: bb73c6199986f664b96b6768cfb73a795c2b8321
    https://github.com/scummvm/scummvm/commit/bb73c6199986f664b96b6768cfb73a795c2b8321
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-10-29T20:47:24Z

Commit Message:
COMMIT: Add missing destruction of elements when downsizing an Array

Changed paths:
    common/array.h


diff --git a/common/array.h b/common/array.h
index bfa83b5c17..7613d72674 100644
--- a/common/array.h
+++ b/common/array.h
@@ -332,6 +332,8 @@ public:
 
 	void resize(size_type newSize) {
 		reserve(newSize);
+		for (size_type i = newSize; i < _size; ++i)
+			_storage[i].~T();
 		for (size_type i = _size; i < newSize; ++i)
 			new ((void *)&_storage[i]) T();
 		_size = newSize;




More information about the Scummvm-git-logs mailing list