Skip to content

Commit

Permalink
[backport Humble] use cv::DestroyAllWindows (#863) (#864)
Browse files Browse the repository at this point in the history
This ports #816 to ROS 2 and prevents weird exit conditions if you
already closed the window

backport #863

Co-authored-by: Michael Ferguson <mfergs7@gmail.com>
  • Loading branch information
ahcorde and mikeferguson authored Jan 19, 2024
1 parent eda1c8c commit 6d5edd8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion image_view/src/disparity_view_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ DisparityViewNode::DisparityViewNode(const rclcpp::NodeOptions & options)

DisparityViewNode::~DisparityViewNode()
{
cv::destroyWindow(window_name_);
cv::destroyAllWindows();
}

void DisparityViewNode::imageCb(const stereo_msgs::msg::DisparityImage::SharedPtr msg)
Expand Down
2 changes: 1 addition & 1 deletion image_view/src/image_view_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void ImageViewNode::windowThread()
}
}

cv::destroyWindow(window_name_);
cv::destroyAllWindows();

if (rclcpp::ok()) {
rclcpp::shutdown();
Expand Down

0 comments on commit 6d5edd8

Please sign in to comment.