P
Pohihihi
Hello,
I have 3 form (e.g. A, B, C). Form A has collection that is passed to Form B which in turn pass that to Form C. Now this is reference rather than a copy. Now I am creating my object from my class in Form C and conditionally adding it to collection in Form A. After adding that object I dispose Form C, and user can close Form B as they want or continue with other things.
Assuming: when I add my object to the collection in Form A it is added as reference in the list of collection (as it is a big object and no copy is happening so collection will add the ref for the object in its collection list).
Question is, when I dispose Form C will the my-object that I created in Form C still exsists, and in turn some how Form C is also not disposed (GCed) as my object is part of it?
What is really happening behind?
Thanks,
Po
I have 3 form (e.g. A, B, C). Form A has collection that is passed to Form B which in turn pass that to Form C. Now this is reference rather than a copy. Now I am creating my object from my class in Form C and conditionally adding it to collection in Form A. After adding that object I dispose Form C, and user can close Form B as they want or continue with other things.
Assuming: when I add my object to the collection in Form A it is added as reference in the list of collection (as it is a big object and no copy is happening so collection will add the ref for the object in its collection list).
Question is, when I dispose Form C will the my-object that I created in Form C still exsists, and in turn some how Form C is also not disposed (GCed) as my object is part of it?
What is really happening behind?
Thanks,
Po