destroyAllWindows
destroyAllWindows is a function in OpenCV's HighGUI module that closes and destroys all windows created by imshow or namedWindow during a program's execution. It releases the GUI resources associated with those windows and removes them from the screen. The call is independent of the main application and does not terminate the process; it only affects the graphical windows.
When invoked, destroyAllWindows closes every open HighGUI window and clears the internal window registry. It is
Usage across language bindings: In C++, the function is cv::destroyAllWindows(); In Python, the equivalent is cv2.destroyAllWindows();
Related functions include destroyWindow(name), which closes a specific window, and waitKey, which processes GUI events and
Notes: On some builds or backends, destroying all windows may be necessary to ensure a clean exit
See also: destroyWindow, imshow, namedWindow, waitKey, HighGUI module.