Fix Cycles assert on exit after recent changes

This commit is contained in:
Brecht Van Lommel 2019-05-03 17:42:08 +02:00
parent 888852055c
commit a5c89574a3
2 changed files with 9 additions and 1 deletions

@ -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();

@ -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__ */