title: DestroyWindow does not close window on Mac using Python and OpenCV
body: <p>My program generates a series of windows using the following code:</p>
  
  <pre><code>def display(img, name, fun):
      global clicked
  
      cv.NamedWindow(name, 1)
      cv.ShowImage(name, img)
      cv.SetMouseCallback(name, fun, img)
  
      while cv.WaitKey(33) == -1:
          if clicked == 1:
              clicked = 0
              cv.ShowImage(name, img)
  
      cv.DestroyWindow(name)
  </code></pre>
  
  <p>I press "q" within the gui window to close it. However, the code continues to the next call of the display function and displays a second gui window while not closing the first. I'm using a Mac with OpenCV 2.1, running the program in Terminal. How can I close the gui windows? Thanks.</p>