Jump to content

Destruct object from an Array after Cleanup


Recommended Posts

I am trying to figure out if i'm missing something in my approach.

I am using an Array of Objects as Class Data of a handler Class. I Dynamically add these Instanced to the handler and when i'm done, I'd like them to be released from memory.

 

When adding the Instance of the class (using the Insert Into Array function of LabVIEW), I call methods to add the data, set a status and create a file backup of the object so it can be retrieved after a program restart.

post-27848-0-03718700-1458544374.png

 

When I'm done I'd like to remove the Instance from the Array by using the Delete From Array function of LabVIEW and delete the file backup of the object like this:

post-27848-0-20718800-1458544379.png

 

My question is if the Instance of the probe object still remains in memory after this and if so, is there any way I can tell LabVIEW to destruct it?

 

Cheers,

 

Robert

 

 

Link to comment

My question is if the Instance of the probe object still remains in memory after this and if so, is there any way I can tell LabVIEW to destruct it?

 

The way your VI is implemented is the correct way to dispose of objects (or any given non-reference type in LabVIEW).

The wire has "loose" ends (after the last VI), so that particular copy of the object is removed from memory automatically.

 

Only reference-types must be closed explicitly (like the DVR). So your final VI just has to take care of references within that object to prevent reference leaks.

Link to comment

The way your VI is implemented is the correct way to dispose of objects (or any given non-reference type in LabVIEW).

The wire has "loose" ends (after the last VI), so that particular copy of the object is removed from memory automatically.

 

Only reference-types must be closed explicitly (like the DVR). So your final VI just has to take care of references within that object to prevent reference leaks.

 

Danke :)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.