Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ubuntu destroyAllWindows bug?

I am using OpenCV on Ubuntu 14.04. When I call the destroyAllWindows() functions It closes all the windows in which there were displayed images, but it still remains in the side-bar (see picture below):

image description

I call the imshow() function in more classes functions and I am getting this problem. I have tried to simulate it in a simple for loop, but it is not doing the same. I think the problem is in my code. It is too big to post it all, so any suggestions why this may happen?

As a parenthesis: I have some kind of object displayer and in it I am doing a display image function and a close all window function:

class Displayer
{
public:
  Displayer() {}
  ~Displayer() {}

  void displayImg(const cv::Mat& image, const std::string& name, bool flg)
  {
    if (flg)
    {
      cv::imshow(wnm, m);
      cv::waitKey();
    }
  }

  void closeAllWindows() { cv::destroyAllWindows(); }
};

I am using it for easier display, not display, based on that flag. It is true that I create more than one object, could it be because of that?