diff options
Diffstat (limited to 'core/templates/cowdata.h')
-rw-r--r-- | core/templates/cowdata.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index e33822fedf..d446c81721 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -286,7 +286,7 @@ Error CowData<T>::resize(int p_size) { if (current_size == 0) { // alloc from scratch uint32_t *ptr = (uint32_t *)Memory::alloc_static(alloc_size, true); - ERR_FAIL_COND_V(!ptr, ERR_OUT_OF_MEMORY); + ERR_FAIL_NULL_V(ptr, ERR_OUT_OF_MEMORY); *(ptr - 1) = 0; //size, currently none new (ptr - 2) SafeNumeric<uint32_t>(1); //refcount @@ -294,7 +294,7 @@ Error CowData<T>::resize(int p_size) { } else { uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true); - ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY); + ERR_FAIL_NULL_V(_ptrnew, ERR_OUT_OF_MEMORY); new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount _ptr = (T *)(_ptrnew); @@ -324,7 +324,7 @@ Error CowData<T>::resize(int p_size) { if (alloc_size != current_alloc_size) { uint32_t *_ptrnew = (uint32_t *)Memory::realloc_static(_ptr, alloc_size, true); - ERR_FAIL_COND_V(!_ptrnew, ERR_OUT_OF_MEMORY); + ERR_FAIL_NULL_V(_ptrnew, ERR_OUT_OF_MEMORY); new (_ptrnew - 2) SafeNumeric<uint32_t>(rc); //refcount _ptr = (T *)(_ptrnew); |