LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cleaning up child class on parent wire

I have a child class running on a parent wire. The parent class has a reference, and the child class has some additional references. I want to clean these up during shutdown. But, because it is a parent wire, I cannot call my child class's "destroy" method directly. Is the best way to handle this to have destroy.vi be dynamic dispatch, so it will call the child's destroy method via DD, and set "call parent method" to required? This way if the class is a child, it will dynamic dispatch the child's method, but force the programmer to also call the parent method? How have others handled this?

0 Kudos
Message 1 of 2
(2,464 Views)

@for(imstuck) wrote:

Is the best way to handle this to have destroy.vi be dynamic dispatch...?


Yes. That's the whole point of DD.

 

Note that for cleaning up resources, the order of the cleanup might be important, so either write in such a way that it doesn't matter or document it so that the developer of the child class knows exactly when the parent destroy should be called.


___________________
Try to take over the world!
Message 2 of 2
(2,459 Views)