LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Destroying and unregistering events

Solved!
Go to solution

Should you unregister an event before destroying it or destroy it first? Or does it matter?

=====================
LabVIEW 2012


0 Kudos
Message 1 of 3
(2,904 Views)
Solution
Accepted by topic author SteveChandler

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.

*************************************************
CLD
*************************************************
Message 2 of 3
(2,890 Views)

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.

=====================
LabVIEW 2012


0 Kudos
Message 3 of 3
(2,851 Views)