diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-03 18:42:08 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-03 19:04:47 +0300 |
commit | a5c89574a3f7e915dd3fe44a73f7f184ce1758e2 (patch) | |
tree | afe134ae4dc4869a9bca95aff01c8d6e87572f5c /intern | |
parent | 888852055c1b203f5a89c7e229f87f412a6624da (diff) |
Fix Cycles assert on exit after recent changes
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device_cpu.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/util/util_aligned_malloc.h | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/device/device_cpu.cpp b/intern/cycles/device/device_cpu.cpp index 32911e054fe..5d279ebb965 100644 --- a/intern/cycles/device/device_cpu.cpp +++ b/intern/cycles/device/device_cpu.cpp @@ -321,7 +321,7 @@ class CPUDevice : public Device { ~CPUDevice() { #ifdef WITH_OSL - delete osl_globals; + util_aligned_delete(osl_globals); #endif task_pool.stop(); texture_info.free(); diff --git a/intern/cycles/util/util_aligned_malloc.h b/intern/cycles/util/util_aligned_malloc.h index a76884b20a5..7115e4cb0c6 100644 --- a/intern/cycles/util/util_aligned_malloc.h +++ b/intern/cycles/util/util_aligned_malloc.h @@ -37,6 +37,14 @@ template<typename T> T *util_aligned_new() return new (mem) T(); } +template<typename T> void util_aligned_delete(T *t) +{ + if (t) { + t->~T(); + util_aligned_free(t); + } +} + CCL_NAMESPACE_END #endif /* __UTIL_ALIGNED_MALLOC_H__ */ |