Skip to content

Commit

Permalink
fix: do not call exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Malkowski committed Nov 9, 2018
1 parent c747db5 commit 6c4e988
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion realsense2_camera/src/realsense_node_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,15 @@ void RealSenseNodeFactory::notification_handler(const rs2::notification &n, int
catch (...)
{
ROS_ERROR_STREAM("realsense_camera: device " << _usb_port_id << " unknown exception has occurred while calling addDevice on new device. Exiting...");
exit(1);
if (ros::isShuttingDown())
{
ROS_ERROR_STREAM("ROS is shutting down returning early");
return;
}
ros::requestShutdown();
ros::shutdown();
sleep(5);
return;
}
ROS_INFO_STREAM("realsense_camera: device " << _usb_port_id << " found... and was added");
found = true;
Expand Down

0 comments on commit 6c4e988

Please sign in to comment.