With the release of LabVIEW NXG 2.0, the behavior of the Close button on your built application has changed. The Close button no longer results in your code possibly terminating before it is finished. Instead, you must handle the “Window”:Close event, treating the Close button like any other control that can cause your application to shut down. The application exits when your code is finished.
The Close button on a LabVIEW NXG 2.0 application.
In the figure above, the Close button, caught by the “Window”:Close event, and the Stop button are handled in the same event case, simply passing a True to the conditional terminal of the while loop, ending the application.