NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in DisplayNewUserDialog Method?

Solved!
Go to solution

I am calling DisplayNewUserDialog from a VI, adding the returned userObject to the UsersFile, and closing all references. When I exit the program directly after doing this, I consistently get warnings like described below. I can't find any more references to close!

 

DisplayNewUserDialog.png

 

 

References to PropertyObjects were not released properly.
    Total number of objects: 84
    Number of top-level objects: 3

    Note: Some top-level objects may be included if they are referenced by
    an incorrectly released top-level object. For example, an unreleased
    SequenceContext object references a SequenceFile object.

    The following top-level objects were not released:

        Type Definitions [2 object(s) not released]
            Type Definition #1:
                Name: User

            Type Definition #2:
                Name: NI_UserCustomPrivileges


        And the following uncategoried objects:
            User
                Name: generic.user


0 Kudos
Message 1 of 4
(2,722 Views)

Here is the code using the returned userObject. (The reference gets closed by the caller).

Add user.png

0 Kudos
Message 2 of 4
(2,721 Views)
Solution
Accepted by topic author gizmogal

Here is a guess...

 

Try closing the reference from your 'AsPropertyObject' from the 'user' property node.  This is the reference you are adding to the SetPropertyObjectbyOffset.

 

Otherwise, I find it odd you have closed the 'UsersFile' before closing the 'UserList' refnum, but maybe that doesn't make a difference.

 

Good luck,

PH

0 Kudos
Message 3 of 4
(2,714 Views)

@Teds wrote:

Here is a guess...

 

Try closing the reference from your 'AsPropertyObject' from the 'user' property node.  This is the reference you are adding to the SetPropertyObjectbyOffset.

 

Otherwise, I find it odd you have closed the 'UsersFile' before closing the 'UserList' refnum, but maybe that doesn't make a difference.

 

Good luck,

PH


Hi PH,

 

Thanks! That actually worked! You're right that it looks like I'm closing my references out of order, but it seems to me that the order doesn't matter since I'm done with them all by the time all the error wires get connected to the close VI's. But in the interest of clarity I will rearrange so the closures are in reverse order of use.

 

Thanks for the help. I can check my code in and have a nice weekend now.

 

Gizmogal

0 Kudos
Message 4 of 4
(2,711 Views)