Click here to Skip to main content
15,902,892 members
Home / Discussions / C#
   

C#

 
QuestionProblem with Byte Pin
softwarejaeger7-Aug-08 3:17
softwarejaeger7-Aug-08 3:17 
AnswerRe: Problem with Byte Pin
leppie7-Aug-08 3:32
leppie7-Aug-08 3:32 
GeneralRe: Problem with Byte Pin
softwarejaeger7-Aug-08 3:36
softwarejaeger7-Aug-08 3:36 
GeneralRe: Problem with Byte Pin
leppie7-Aug-08 3:43
leppie7-Aug-08 3:43 
GeneralRe: Problem with Byte Pin
#realJSOP7-Aug-08 4:19
professional#realJSOP7-Aug-08 4:19 
GeneralRe: Problem with Byte Pin
softwarejaeger7-Aug-08 3:58
softwarejaeger7-Aug-08 3:58 
AnswerRe: Problem with Byte Pin
#realJSOP7-Aug-08 4:16
professional#realJSOP7-Aug-08 4:16 
GeneralRe: Problem with Byte Pin
leppie7-Aug-08 5:15
leppie7-Aug-08 5:15 
GeneralRe: Problem with Byte [modified] Pin
#realJSOP7-Aug-08 5:50
professional#realJSOP7-Aug-08 5:50 
GeneralRe: Problem with Byte [modified] Pin
Daniel Grunwald7-Aug-08 6:24
Daniel Grunwald7-Aug-08 6:24 
AnswerRe: Problem with Byte Pin
Daniel Grunwald7-Aug-08 6:32
Daniel Grunwald7-Aug-08 6:32 
QuestionExcel Pin
ellllllllie7-Aug-08 3:11
ellllllllie7-Aug-08 3:11 
AnswerRe: Excel Pin
Indivara7-Aug-08 4:56
professionalIndivara7-Aug-08 4:56 
QuestionC# Packet Question Pin
Spiro Floropoulos7-Aug-08 2:29
Spiro Floropoulos7-Aug-08 2:29 
AnswerRe: C# Packet Question Pin
leppie7-Aug-08 2:51
leppie7-Aug-08 2:51 
GeneralRe: C# Packet Question Pin
Spiro Floropoulos7-Aug-08 2:58
Spiro Floropoulos7-Aug-08 2:58 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:02
leppie7-Aug-08 3:02 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:03
leppie7-Aug-08 3:03 
GeneralRe: C# Packet Question Pin
Spiro Floropoulos7-Aug-08 3:26
Spiro Floropoulos7-Aug-08 3:26 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:29
leppie7-Aug-08 3:29 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 4:19
leppie7-Aug-08 4:19 
QuestionDelete Object from Memory? Pin
softwarejaeger7-Aug-08 2:26
softwarejaeger7-Aug-08 2:26 
AnswerRe: Delete Object from Memory? Pin
Simon P Stevens7-Aug-08 2:42
Simon P Stevens7-Aug-08 2:42 
AnswerRe: Delete Object from Memory? Pin
#realJSOP7-Aug-08 2:44
professional#realJSOP7-Aug-08 2:44 
AnswerRe: Delete Object from Memory? Pin
Guffa7-Aug-08 2:55
Guffa7-Aug-08 2:55 
What you mean is that you create instances of the classes, i.e. object with that class as type.

Unless you are using unmanaged resources in your objects, you don't have to do anything at all. When the object isn't used any more, it will eventually get removed by the garbage collector.

You can set the reference to null if it's a variable that you are keeping, i.e. a member variable in an object that you will keep using (for example a member variable in a Form).

If it's a local variable that will go out of scope, you don't need to remove the reference. Setting the variable to null in that case will not affect the memory management at all.


Creating objects that is used for a very short time is very common in .NET. Take for example a statement like this (items and pages are integers):

string x = "There were " + items + " items in " + pages + " pages.";

This will create five short lived objects (two boxed integers, one object array and two strings containing the string representations of the integers) which will be up for garbage collection once the string is created.

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

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.