title: Python OpenCV - VideoCapture.release() won't work in Linux
body: <p>I'm using OpenCV 2.4.9 and Python 2.7.11.</p>
  
  <p>I've written a small program that shows the camera output, and when pressing 'q', closes the camera but doesn't exit the application (for further work...).</p>
  
  <p>The issue is that the webcam is not really released, the LED keeps on and when I try again to open it, it says that the resource is busy, until I completely exit the program.
  It DOES work ok in Windows, though...</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import cv2
  import sys
  
  
  cap = cv2.VideoCapture(0)
  
  while True:
      ret, frame = cap.read()
      if frame is None:
          print "BYE"
          break
  
      cv2.imshow('frame', frame)    
      if cv2.waitKey(1) &amp; 0xFF == ord('q'):
          break       
  
  cap.release()
  cv2.destroyAllWindows()
  while True:
      cv2.waitKey(1)
  </code></pre>
  
  <p>What am I missing? Is there a way to free the camera without exiting the program?
  Thanks in advance</p>