Fix for bad memory leak in OSL: the context created for each OSL sample did not get...
authorLukas Toenne <lukas.toenne@googlemail.com>
Tue, 4 Sep 2012 08:53:44 +0000 (08:53 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Tue, 4 Sep 2012 08:53:44 +0000 (08:53 +0000)
intern/cycles/kernel/osl/osl_shader.cpp

index 345614c2868450e5ca9ffd7d93e677e8052140c5..a7c21e7b595bcfbc3f0b001c2257258bb278c4be 100644 (file)
@@ -382,10 +382,8 @@ void OSLShader::eval_displacement(KernelGlobals *kg, ShaderData *sd)
 void OSLShader::release(KernelGlobals *kg, const ShaderData *sd)
 {
        OSL::ShadingSystem *ss = kg->osl.ss;
-       OSLGlobals::ThreadData *tdata = tls_get(OSLGlobals::ThreadData, kg->osl.thread_data);
-       OSL::ShadingContext *ctx = ss->get_context(tdata->thread_info);
-
-       ss->release_context(ctx);
+       
+       ss->release_context((OSL::ShadingContext *)sd->osl_ctx);
 }
 
 /* BSDF Closure */