diff options
Diffstat (limited to 'intern/cycles')
-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__ */ |