09-03-2016 05:35 PM
@shamerox wrote:Then if I release the Queue once that means I am not using the Queue anymore right. Why should I release it as much time as I am obtaining it?
Each time you Obtain Queue, you are creating a new reference. Assuming you are using named queues to get a reference to a the same queue, you are creating an additional reference to that queue. Therefore, you need to release the queue for every reference you obtain for that queue. Only when all of the references have been released with the queue actually be destroyed.
09-04-2016 11:30 AM
Adding to crossrulz, you can do force destroy to destroy all references in single shot also.
-I just tried to create same and check the results in attached images:
Case 1: Two Obtain Queues used with same name:
The destop execution trace toolkit trace clearly shows the Reference leaks after the VI execution completes. Also can notice the second Obtain queue details showing Obtain Existing but with different reference.
Case 2: With One Release Queue-Corresponding trace below the corresponding queue released and the reference leak for other queue. Notice that Release Queue details as Released.
Case 3: Using Release Queue for both references
-Corresponding Trace below showing First Release Queue as Released and Second one destroys the Queue hence all references are cleared.
Case 4: Force Destroy
-Corresponding Trace below showing both queue references destroyed with single usage of reference queue but with Force destroy made TRUE.
Hope this clears your question 🙂
09-04-2016 12:10 PM
Wow!! That's a cool and intuitive way of explaining. Thank you!
Just to clear things up, if you want to do both releasing the Queue and destroying all the references created, at one place, then you can use the Release Queue function with Force destroy enabled. This would not have any reference leaks as depicted by your case 4. So no second thoughts on using it.
Note: I do understand that if any postprocess tries to access the Queue, it would creaete errors.
And, that tool you use to trace the processes, is that a LabVIEW addon.
09-04-2016 12:21 PM