02-28-2011 05:09 PM
Should you unregister an event before destroying it or destroy it first? Or does it matter?
Solved! Go to Solution.
02-28-2011 08:32 PM
When the event is no longer needed it is recommended to unregister for events. If you do not unregister events LabVIEW continues to generate and queue the events as long as the VI runs even if no event structure is waiting to handle it. Of course this will consume memory and would eventually lead to other problems based on the application.
I would think if your application needs to register the events again at some point only use unregister for events otherwise calling destroy user events after unregister for events sounds to be the sequence of usage.
03-01-2011 12:05 PM
Thanks. I should have prefaced this by saying that I will not be generating any more events. This is after my loops have exited and the application is shutting down.
I typically unregister then destroy but I ran into a situation where the wiring is more convenient if I destroy first. Using the desktop execution trace toolkit did not show any leaks or errors or anything that doesn't look right so I guess it doesn't matter when doing an application shutdown if I destroy first.
Thanks again.