Skip to content

Commit

Permalink
unload engine in gzrenderer
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Aug 17, 2023
1 parent fd2a22b commit b5e10a4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/plugins/minimal_scene/MinimalScene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,18 +679,21 @@ void GzRenderer::Destroy()
return;
scene->DestroySensor(this->dataPtr->camera);

// clean up in the rendering thread
this->dataPtr->camera.reset();
this->dataPtr->rayQuery.reset();

// If that was the last sensor, destroy scene
if (scene->SensorCount() == 0)
{
gzdbg << "Destroy scene [" << scene->Name() << "]" << std::endl;
engine->DestroyScene(scene);

// TODO(anyone) If that was the last scene, terminate engine?
if (engine->SceneCount() == 0)
rendering::unloadEngine(engine->Name());
}

// clean up in the rendering thread
this->dataPtr->camera.reset();
this->dataPtr->rayQuery.reset();
std::cerr << "================ GzRenderer Destroy " << std::endl;
}

Expand Down

0 comments on commit b5e10a4

Please sign in to comment.