From e0a90e1038b4dbe1bcf660bba5d1524e13786611 Mon Sep 17 00:00:00 2001 From: David Leins Date: Fri, 6 Dec 2024 20:20:45 +0100 Subject: [PATCH] build: prevents unreachable code on NO_BACKENerror --- mujoco_ros/src/offscreen_rendering.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mujoco_ros/src/offscreen_rendering.cpp b/mujoco_ros/src/offscreen_rendering.cpp index 253e5b5..63a2c16 100644 --- a/mujoco_ros/src/offscreen_rendering.cpp +++ b/mujoco_ros/src/offscreen_rendering.cpp @@ -351,14 +351,17 @@ void MujocoEnv::offscreenRenderLoop() offscreen_.request_pending.store(false); return; } -#else +#endif + +#if RENDER_BACKEND == NO_BACKEND ROS_ERROR("No offscreen rendering backend available. Cannot run offscreen rendering"); settings_.render_offscreen = false; settings_.visual_init_request = false; offscreen_.request_pending.store(false); + is_rendering_running_ = 0; + ROS_DEBUG("Exiting offscreen render loop"); return; -#endif - +#else is_rendering_running_ = 1; ROS_DEBUG_NAMED("offscreen_rendering", "Creating offscreen rendering resources ..."); mjv_defaultCamera(&offscreen_.cam); @@ -414,6 +417,7 @@ void MujocoEnv::offscreenRenderLoop() } is_rendering_running_ = 0; ROS_DEBUG("Exiting offscreen render loop"); +#endif } } // namespace mujoco_ros