QControl Enthusiasts

Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.
Solved! Go to solution

Closing control reference?

Does the control reference fed to the Qcontrol ever get closed somewhere? I see where the State data and event handler are closed, but it looks like the reference is left open. Is that correct? If so, is it intentional?

Message 1 of 4
(197 Views)
3 REPLIES 3
Highlighted
Solution
Accepted by topic author BertMcMahan
04-12-2019 01:59 PM

Re: Closing control reference?

Control references never need to be closed. More generally, nothing that inherits from GObject ever needs to be closed. LabVIEW manages those references internally, and trying to close them is a no-op.

 

See my Brainless LabVIEW presentation for more info.

DNatt, LV R&D
Message 2 of 4
(196 Views)

Re: Closing control reference?

Ah TIL! I usually try to rabidly close references because that's the "conventional wisdom"- when you open a reference somewhere, you must close it elsewhere. I'd assumed most of these references worked the same way as, say, a queue reference worked, where each "obtain reference" was unique.

 

Thanks for that presentation, it's very informative. I need me one of those mousepads Smiley Wink

0 Kudos
Message 3 of 4
(193 Views)

Re: Closing control reference?

On a similar note, it is best to always use the Close method on every QControl.  However, if you forget, I did make it smart enough that the orphaned Event Handler would be stopped automatically as to not hang your application.


Quentin "Q" Alldredge

Q Software Innovations, LLC (QSI)

CLA, LabVIEW Champion

NI Alliance Partner

LabVIEW Wiki (labviewwiki.org)

Message 4 of 4
(175 Views)
Reply
This is an open group. Sign in and click the "Join Group" button to become a group member and start posting.