forked from bartvdbraak/blender
Fix T60434: crash with OSL and viewport + preview render at the same time.
Don't free LLVM JIT memory until process exit, there might be multiple OSL instances using it.
This commit is contained in:
parent
6a8d87db18
commit
1be16466e7
@ -66,6 +66,10 @@ OSLShaderManager::~OSLShaderManager()
|
||||
{
|
||||
shading_system_free();
|
||||
texture_system_free();
|
||||
}
|
||||
|
||||
void OSLShaderManager::free_memory()
|
||||
{
|
||||
#ifdef OSL_HAS_BLENDER_CLEANUP_FIX
|
||||
/* There is a problem with llvm+osl: The order global destructors across
|
||||
* different compilation units run cannot be guaranteed, on windows this means
|
||||
|
@ -70,6 +70,8 @@ public:
|
||||
OSLShaderManager();
|
||||
~OSLShaderManager();
|
||||
|
||||
static void free_memory();
|
||||
|
||||
void reset(Scene *scene);
|
||||
|
||||
bool use_osl() { return true; }
|
||||
|
@ -692,6 +692,10 @@ void ShaderManager::get_requested_features(Scene *scene,
|
||||
void ShaderManager::free_memory()
|
||||
{
|
||||
beckmann_table.free_memory();
|
||||
|
||||
#ifdef WITH_OSL
|
||||
OSLShaderManager::free_memory();
|
||||
#endif
|
||||
}
|
||||
|
||||
float ShaderManager::linear_rgb_to_gray(float3 c)
|
||||
|
Loading…
Reference in New Issue
Block a user