Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_generic_array.hh')
-rw-r--r--source/blender/blenlib/BLI_generic_array.hh6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_generic_array.hh b/source/blender/blenlib/BLI_generic_array.hh
index 4b917434264..03dc8814309 100644
--- a/source/blender/blenlib/BLI_generic_array.hh
+++ b/source/blender/blenlib/BLI_generic_array.hh
@@ -231,7 +231,9 @@ class GArray {
this->deallocate(new_data);
throw;
}
- this->deallocate(data_);
+ if (this->data_) {
+ this->deallocate(data_);
+ }
data_ = new_data;
}
@@ -243,7 +245,7 @@ class GArray {
{
const int64_t item_size = type_->size();
const int64_t alignment = type_->alignment();
- return allocator_.allocate(static_cast<size_t>(size) * item_size, alignment, AT);
+ return allocator_.allocate(size_t(size) * item_size, alignment, AT);
}
void deallocate(void *ptr)