title: Imshow from opencv is not working anymore
body: <p>I wrote some simple programs using imshow function. It worked fine few times. I've tried to view two pictures, before and after processing. For the first time it worked fine, but the second time it crashed my application. </p>
  
  <p>Now imshow crash application every time.</p>
  
  <p>How to fix that? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;iostream&gt;
  #include &lt;opencv2/imgproc/imgproc.hpp&gt;
  #include &lt;opencv2/core/core.hpp&gt;
  #include &lt;opencv2/highgui/highgui.hpp&gt;
  
  using namespace std;
  using namespace cv;
  
  int main()
  {
      Mat image, gray_image;
      string file_path;
  
      cout &lt;&lt; "Input file path: ";
      cin &gt;&gt; file_path;
  
      image = imread(file_path, CV_LOAD_IMAGE_UNCHANGED);
      if (image.data==NULL)
          {
              cout &lt;&lt; "No image found!";
              return 1;
          }
  
      cvtColor(image, gray_image, CV_BGR2GRAY);
  
      namedWindow("Orig", CV_WINDOW_AUTOSIZE);
      namedWindow("Gray", CV_WINDOW_AUTOSIZE);
  
      imshow("Orig", image);
      imshow("Gray", gray_image);
  
      cout &lt;&lt; "Output file path: ";
      cin &gt;&gt; file_path;
  
      imwrite(file_path, gray_image);
  
      return 0;
  }
  </code></pre>