title: What is the use of function destroyAllWindows() if the window automatically gets destroyed using waitKey() function?
body: <pre><code>#!/usr/bin/python3    
  import cv2     
  cam=cv2.VideoCapture(0)
  </code></pre>
  
  <p>checking if camera is working!!</p>
  
  <pre><code>cam.isOpened():
      print("Working")
  
  while(cam.isOpened()):
      status,frame=cam.read()
      cv2.imshow('camera1',frame)
      if cv2.waitKey(1) &amp; 0xFF==ord('q') :
              break
  </code></pre>
  
  <p><strong>Removing windows by calling below function</strong><br>
   If i dont write this function then  also it will run properly!!</p>
  
  <pre><code>   cv2.destroyAllWindows()
     cam.release()
  </code></pre>