Skip to content

Commit a7f454d

Browse files
committed
Fix mutex lock error during streamer destruction.
1 parent 46f55e9 commit a7f454d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ros_compressed_streamer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ void RosCompressedStreamer::convertGrayscale16toGrayscaleAlpha(const sensor_msgs
102102
}
103103

104104
void RosCompressedStreamer::imageCallback(const sensor_msgs::CompressedImageConstPtr &msg) {
105+
if (inactive_)
106+
return;
107+
105108
boost::mutex::scoped_lock lock(send_mutex_); // protects last_msg and last_frame
106109
last_msg = msg;
107110
last_frame = ros::Time(msg->header.stamp.sec, msg->header.stamp.nsec);

0 commit comments

Comments
 (0)