[Bf-blender-cvs] [30d7e0814f2] functions: fix SmallVector

Jacques Lucke noreply at git.blender.org
Mon Feb 18 16:00:54 CET 2019


Commit: 30d7e0814f2216a1b22bd1c0c3a01ca13bfa943d
Author: Jacques Lucke
Date:   Mon Feb 18 15:00:33 2019 +0100
Branches: functions
https://developer.blender.org/rB30d7e0814f2216a1b22bd1c0c3a01ca13bfa943d

fix SmallVector

===================================================================

M	source/blender/blenlib/BLI_small_vector.hpp

===================================================================

diff --git a/source/blender/blenlib/BLI_small_vector.hpp b/source/blender/blenlib/BLI_small_vector.hpp
index 8ed42027e4a..8af9945d3da 100644
--- a/source/blender/blenlib/BLI_small_vector.hpp
+++ b/source/blender/blenlib/BLI_small_vector.hpp
@@ -5,6 +5,7 @@
 #include <cstring>
 #include <memory>
 #include <iostream>
+#include <algorithm>
 
 namespace BLI {
 
@@ -54,7 +55,9 @@ namespace BLI {
 
 		~SmallVector()
 		{
-			this->destruct_elements_and_free_memory();
+			if (m_elements != nullptr) {
+				this->destruct_elements_and_free_memory();
+			}
 		}
 
 		SmallVector &operator=(const SmallVector &other)



More information about the Bf-blender-cvs mailing list