Fix for OSL memory leak. The context creation for OSL is now done in the shader_setup_* functions, since it should specific to the sample being worked on. The the context release then happens in the kernel_shader functions after shader evaluation is done. Care has to be taken to ensure the shader_release function is also called in cases where the path integration is cancelled early, this was the main cause for unreleased contexts and subsequent new allocations.

This commit is contained in:
Lukas Toenne
2012-09-05 08:12:22 +00:00
parent 99fcec3334
commit f3a91f461c
5 changed files with 57 additions and 17 deletions

View File

@@ -79,7 +79,8 @@ public:
const float3 omega_in, const float3 omega_out);
/* release */
static void release(KernelGlobals *kg, const ShaderData *sd);
static void init(KernelGlobals *kg, ShaderData *sd);
static void release(KernelGlobals *kg, ShaderData *sd);
};
CCL_NAMESPACE_END