Click here to Skip to main content
15,913,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: Browsable attribute help... Pin
Zombies with Coffee, LLC28-Jun-02 4:53
professionalZombies with Coffee, LLC28-Jun-02 4:53 
Questionwatch port? Pin
27-Jun-02 15:02
suss27-Jun-02 15:02 
AnswerRe: watch port? Pin
Venet28-Jun-02 3:58
Venet28-Jun-02 3:58 
GeneralRe: watch port? Pin
28-Jun-02 5:40
suss28-Jun-02 5:40 
GeneralCustom ListBox Wev Control Pin
27-Jun-02 9:48
suss27-Jun-02 9:48 
GeneralHelp with clearing checkboxes in a listview Pin
cAptHiDDeN27-Jun-02 8:56
cAptHiDDeN27-Jun-02 8:56 
QuestionHow to implement "class factory" in C# Pin
Feng Qin27-Jun-02 1:44
Feng Qin27-Jun-02 1:44 
AnswerRe: How to implement "class factory" in C# Pin
Marc Clifton27-Jun-02 2:01
mvaMarc Clifton27-Jun-02 2:01 
My (very new) understanding of C# is this:

In CreateDataInfo2 you are instantiating the object DataInfo() and assigning a reference to it in the local DataInfo di. Therefore the reference count to this object is one. Whe you are return the reference and assign it to another DataInfo object in Main(), the reference count goes to two. Now, the local variable in CreateDataInfo2 goes out of scope, and the reference count to the di created in that method goes back to one. So the count of objects referencing the DataInfo is still one, and therefore the object is not released.

The same applies to CreateDataInfo3, except is a simpler case.

Is this right, anyone?

Marc
GeneralRe: How to implement "class factory" in C# Pin
Feng Qin27-Jun-02 3:05
Feng Qin27-Jun-02 3:05 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson27-Jun-02 16:05
James T. Johnson27-Jun-02 16:05 
GeneralRe: How to implement "class factory" in C# Pin
Marc Clifton27-Jun-02 16:22
mvaMarc Clifton27-Jun-02 16:22 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson27-Jun-02 16:42
James T. Johnson27-Jun-02 16:42 
GeneralRe: How to implement "class factory" in C# Pin
Marc Clifton28-Jun-02 0:37
mvaMarc Clifton28-Jun-02 0:37 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson28-Jun-02 11:50
James T. Johnson28-Jun-02 11:50 
GeneralRe: How to implement "class factory" in C# Pin
Feng Qin27-Jun-02 16:45
Feng Qin27-Jun-02 16:45 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson27-Jun-02 17:18
James T. Johnson27-Jun-02 17:18 
GeneralRe: How to implement "class factory" in C# Pin
Feng Qin27-Jun-02 18:33
Feng Qin27-Jun-02 18:33 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson27-Jun-02 18:41
James T. Johnson27-Jun-02 18:41 
GeneralRe: How to implement "class factory" in C# Pin
Feng Qin27-Jun-02 19:06
Feng Qin27-Jun-02 19:06 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson27-Jun-02 19:23
James T. Johnson27-Jun-02 19:23 
GeneralRe: How to implement "class factory" in C# Pin
Marc Clifton28-Jun-02 0:42
mvaMarc Clifton28-Jun-02 0:42 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson28-Jun-02 11:07
James T. Johnson28-Jun-02 11:07 
GeneralRe: How to implement "class factory" in C# Pin
James T. Johnson28-Jun-02 11:43
James T. Johnson28-Jun-02 11:43 
GeneralRe: How to implement "class factory" in C# Pin
Marc Clifton30-Jun-02 5:30
mvaMarc Clifton30-Jun-02 5:30 
GeneralRe: How to implement "class factory" in C# Pin
Feng Qin30-Jun-02 18:41
Feng Qin30-Jun-02 18:41 

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.