I am writing a GUI application that runs on Windows 10 and opens COM ports (at least 4).
There is no explicit closing of the COM ports in the application.
My understanding is that Windows OS will close (unlock) the COM ports as part of terminating the application.
What happens to the COM ports when the application closes?
Should the COM ports be closed, by the application, before the application exits? (For example, in the application's "close" method.)
Our target PC (laptop) sometimes has issues communicating through the COM ports and the PC must be rebooted. Communications is fine after the reboot.
Background:
GUI application written in C++ using MFC.
IDE is Visual Studio 2017
Application runs on Windows 10 (and windows 7).
COM ports are opened using Windows API.