void OSLShader::thread_free(KernelGlobals *kg) { if(!kg->osl) return; OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSLThreadData *tdata = kg->osl_tdata; ss->release_context(tdata->context); ss->destroy_thread_info(tdata->osl_thread_info); delete tdata; kg->osl = NULL; kg->osl_ss = NULL; kg->osl_tdata = NULL; }
void OSLShader::thread_free(KernelGlobals *kg) { if(!kg->osl) return; OSL::ShadingSystem *ss = (OSL::ShadingSystem*)kg->osl_ss; OSLThreadData *tdata = kg->osl_tdata; for(int i = 0; i < SHADER_CONTEXT_NUM; i++) ss->release_context(tdata->context[i]); ss->destroy_thread_info(tdata->osl_thread_info); delete tdata; kg->osl = NULL; kg->osl_ss = NULL; kg->osl_tdata = NULL; }