I don't now what is large for you, but I'd suggest you a lot of work on the architecture. Shared variables (or the older globals) are fast, easy, and lead to problems...
So here my guess, you've got several Vis running in parallel and communicating via shared variables. If that's the way you do it, make a search about producer/consumer design pattern. The basic idea is, that your main UI-Event handler steps out of the loop, starts to close all the communication (queues, notifiers), thus all the other loops will get errors (the codes ar 1122 and 1, you see that I really use that to now the codes by heart). As the error is present, each of the modules is starting the shutdown procedure (as they have to in case of any error), and afterwards I've got a SubVi which checks for error codes 1122 and 1 (note: if you use semaphores, the code for them is different) and clears these errors.
On good thing IMO is to have the error wire branch, feed the lower error in a clear error vi and then into the shutdown code, have the original error in the first input of a Merge error Vi (remove 1122 before) and the shutdown-error-wire to the second.
It's not easy (a lot of work) to implement it that way, but it makes your code pretty robust. During debug time, it's easy to find the module which dosen't terminate correctly.
Hope I was clear on that difficult topic, if not, I try to design an example....
Felix