I had this with a multi threaded application.
One thread was responsible for the configuration data. It read the config file and maintained the configuration data. This thread gets commands over a queue. The last command this thread received was "End". Then the thread called "Config File Close" with "Write File" set to true. In this VI the config file was opened again with replace. At this time the file is existent but empty. When LV or the OS now switched threads and the main thread was running it could happen that it is run through "Exit LabVIEW". Now the applicatin is gone and the file is empty.
I solved this by sending an answer after "Config File Close" returned and the main thread waited for the answer befor calling "Exit labVIEW".
Waldemar
Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions