hooovahh Posted June 2, 2015 Report Share Posted June 2, 2015 I understand cleaning up references is generally a good thing, but is there a reason the JKI State Machine attempts to close the This VI reference of a VI that is in memory? This in my mind is basically a no-op and can be removed because the close can't remove the VI from memory since that is the VI that is running. Which brings me to question why we even get a copy of the This VI reference and put it in the shift register. If you have a property or invoke node set to the VI Server class "VI" then you can leave the reference unwired and it assumes "This VI", which is actually seen in the "Initialize Core Data" case. Is there a good reason to keep a copy of This VI in the cluster? And if so is there a good reason to have a Close Reference in cleanup? Link to comment Share on other sites More sharing options...
Jim Kring Posted June 2, 2015 Report Share Posted June 2, 2015 That's a great question, Brian! I tend to agree with your observations and thinking. I'll check in with others at JKI to see if I learn more about the history behind this and any corner-cases where this serves a useful purpose. Link to comment Share on other sites More sharing options...
Jim Kring Posted February 26, 2018 Report Share Posted February 26, 2018 On 6/2/2015 at 10:30 AM, hooovahh said: I understand cleaning up references is generally a good thing, but is there a reason the JKI State Machine attempts to close the This VI reference of a VI that is in memory? This in my mind is basically a no-op and can be removed because the close can't remove the VI from memory since that is the VI that is running. Which brings me to question why we even get a copy of the This VI reference and put it in the shift register. If you have a property or invoke node set to the VI Server class "VI" then you can leave the reference unwired and it assumes "This VI", which is actually seen in the "Initialize Core Data" case. Is there a good reason to keep a copy of This VI in the cluster? And if so is there a good reason to have a Close Reference in cleanup? Hey Brian. I just asked about this, and the primary thinking is this: even though it's a no-op, it serves to document how to user the "Data: Cleanup" frame. Also, in the case where someone might change the VI Reference constant to an Open VI Reference, it's helpful that we're actually closing it. Why would someone call Open VI Reference? I'm not sure, but one thing I thought of is when a VI wants to hold a reference to itself open, so that if it's Front Panel isn't visible and it's running because someone else opened it by reference to it, then it won't be "garbage collected" (aborted and destroyed) when the reference count goes to zero (since it won't go to zero if it opens an explicit reference to itself). Does that make sense? Do you have any thoughts about that? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.