Skip to content

Commit

Permalink
Avoid segfaults during Scene shutdown
Browse files Browse the repository at this point in the history
The JIT might have shutdown before the `static_accel_shutdown_gpu` is executed.
  • Loading branch information
njroussel committed Jun 5, 2024
1 parent 112d1ae commit 03f5e13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/render/scene_optix.inl
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ MI_VARIANT void Scene<Float, Spectrum>::static_accel_shutdown_gpu() {
/* Decrease the reference count of the pipeline JIT variable.
This will trigger the release of the OptiX pipeline data
structure if no ray tracing calls are pending. */
(void) UInt32::steal(config.pipeline_jit_index);
if (jit_has_backend(JitBackend::CUDA))
(void) UInt32::steal(config.pipeline_jit_index);

for (size_t i = 0; i < 2 * OPTIX_SHAPE_TYPE_COUNT; i++)
free(config.custom_shapes_program_names[i]);
Expand Down

0 comments on commit 03f5e13

Please sign in to comment.