Click here to Skip to main content
15,887,596 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Sakthivel P25-Jun-08 22:40
Sakthivel P25-Jun-08 22:40 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Christian Graus25-Jun-08 22:47
protectorChristian Graus25-Jun-08 22:47 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Sakthivel P25-Jun-08 23:08
Sakthivel P25-Jun-08 23:08 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Christian Graus25-Jun-08 23:35
protectorChristian Graus25-Jun-08 23:35 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Sakthivel P26-Jun-08 0:23
Sakthivel P26-Jun-08 0:23 
AnswerRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Guffa26-Jun-08 1:07
Guffa26-Jun-08 1:07 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Sakthivel P26-Jun-08 5:36
Sakthivel P26-Jun-08 5:36 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Guffa26-Jun-08 16:09
Guffa26-Jun-08 16:09 
Sakthivel P wrote:
Set MyCollect = Nothing 'What happend in this line.

Is it really remove the items (10/15) and delete object (Node)?


No, it doesn't.

As I explained, the collection and all that it contains (assuming that there are no other references to it) are up for garbage collection from the moment that it's not used any more. By the time that you set the reference to Nothing, the collection is already unreachable, so setting the reference to Nothing accomplishes nothing at all. The garbage collector already knows that the collection is no longer used.

In some cases it can be useful to clear a reference, that is if the variable is a member in a class, or if you use the variable later in the code. However, clearing a reference doesn't cause anything at all to happen. It can make an object unreachable so that it can be garbage collected, but it never causes a garbage collection to happen.

Despite everything, the person most likely to be fooling you next is yourself.

GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
supercat927-Jun-08 7:07
supercat927-Jun-08 7:07 
GeneralRe: Set nothing to VB Collection class object, is it really removes items internally. Pin
Guffa27-Jun-08 13:01
Guffa27-Jun-08 13:01 
QuestionDowntime Management - Client-Server Environment Pin
Anoop Brijmohun25-Jun-08 20:25
Anoop Brijmohun25-Jun-08 20:25 
AnswerRe: Downtime Management - Client-Server Environment Pin
Mycroft Holmes26-Jun-08 16:56
professionalMycroft Holmes26-Jun-08 16:56 
GeneralRe: Downtime Management - Client-Server Environment Pin
Anoop Brijmohun26-Jun-08 20:31
Anoop Brijmohun26-Jun-08 20:31 
GeneralRe: Downtime Management - Client-Server Environment Pin
Mycroft Holmes27-Jun-08 0:53
professionalMycroft Holmes27-Jun-08 0:53 
QuestionVB6 rs.close error Pin
Amit Battan Ror25-Jun-08 19:38
Amit Battan Ror25-Jun-08 19:38 
AnswerRe: VB6 rs.close error Pin
Amit Battan Ror25-Jun-08 19:42
Amit Battan Ror25-Jun-08 19:42 
AnswerRe: VB6 rs.close error Pin
~Khatri Mitesh~25-Jun-08 20:39
~Khatri Mitesh~25-Jun-08 20:39 
GeneralRe: VB6 rs.close error Pin
Guffa26-Jun-08 1:11
Guffa26-Jun-08 1:11 
AnswerRe: VB6 rs.close error Pin
Guffa26-Jun-08 1:17
Guffa26-Jun-08 1:17 
AnswerRe: VB6 rs.close error Pin
supercat927-Jun-08 7:26
supercat927-Jun-08 7:26 
GeneralRe: VB6 rs.close error Pin
Amit Battan Ror29-Jun-08 18:10
Amit Battan Ror29-Jun-08 18:10 
QuestionCouldn't resolve default property of object Me. Pin
AR Reddy25-Jun-08 19:33
AR Reddy25-Jun-08 19:33 
AnswerRe: Couldn't resolve default property of object Me. Pin
nishkarsh_k26-Jun-08 0:29
nishkarsh_k26-Jun-08 0:29 
GeneralRe: Couldn't resolve default property of object Me. Pin
AR Reddy26-Jun-08 1:35
AR Reddy26-Jun-08 1:35 
GeneralRe: Couldn't resolve default property of object Me. [modified] Pin
Dave Kreskowiak26-Jun-08 7:06
mveDave Kreskowiak26-Jun-08 7:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.