Click here to Skip to main content
14,935,564 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:03
Memberleppie7-Aug-08 3:03 
GeneralRe: C# Packet Question Pin
Spiro Floropoulos7-Aug-08 3:26
MemberSpiro Floropoulos7-Aug-08 3:26 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 3:29
Memberleppie7-Aug-08 3:29 
GeneralRe: C# Packet Question Pin
leppie7-Aug-08 4:19
Memberleppie7-Aug-08 4:19 
QuestionDelete Object from Memory? Pin
softwarejaeger7-Aug-08 2:26
Membersoftwarejaeger7-Aug-08 2:26 
AnswerRe: Delete Object from Memory? Pin
Simon P Stevens7-Aug-08 2:42
MemberSimon P Stevens7-Aug-08 2:42 
AnswerRe: Delete Object from Memory? Pin
#realJSOP7-Aug-08 2:44
mva#realJSOP7-Aug-08 2:44 
AnswerRe: Delete Object from Memory? Pin
Guffa7-Aug-08 2:55
MemberGuffa7-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.

Questionthe operation could not be completed. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem Pin
laziale7-Aug-08 2:23
Memberlaziale7-Aug-08 2:23 
QuestionVBScript to C# Pin
Mushtaque Nizamani7-Aug-08 1:45
MemberMushtaque Nizamani7-Aug-08 1:45 
AnswerRe: VBScript to C# Pin
AhsanS7-Aug-08 2:04
MemberAhsanS7-Aug-08 2:04 
GeneralRe: VBScript to C# Pin
Mushtaque Nizamani7-Aug-08 2:13
MemberMushtaque Nizamani7-Aug-08 2:13 
QuestionFile Transfer using C# Pin
Ian Uy7-Aug-08 1:44
MemberIan Uy7-Aug-08 1:44 
AnswerRe: File Transfer using C# Pin
Luke Lovegrove7-Aug-08 2:47
MemberLuke Lovegrove7-Aug-08 2:47 
GeneralRe: File Transfer using C# [modified] Pin
Ian Uy7-Aug-08 2:55
MemberIan Uy7-Aug-08 2:55 
GeneralRe: File Transfer using C# Pin
Luke Lovegrove7-Aug-08 3:18
MemberLuke Lovegrove7-Aug-08 3:18 
QuestionC# Equivalent code for C++ Pin
Raheem MA7-Aug-08 1:04
MemberRaheem MA7-Aug-08 1:04 
AnswerRe: C# Equivalent code for C++ Pin
blackjack21507-Aug-08 1:07
Memberblackjack21507-Aug-08 1:07 
GeneralRe: C# Equivalent code for C++ Pin
Raheem MA7-Aug-08 1:15
MemberRaheem MA7-Aug-08 1:15 
AnswerRe: C# Equivalent code for C++ Pin
Guffa7-Aug-08 3:06
MemberGuffa7-Aug-08 3:06 
AnswerRe: C# Equivalent code for C++ Pin
Dave Doknjas7-Aug-08 12:56
MemberDave Doknjas7-Aug-08 12:56 
Questionpop3 encoding problems Pin
GeorgeBerry7-Aug-08 0:30
MemberGeorgeBerry7-Aug-08 0:30 
AnswerRe: pop3 encoding problems Pin
leppie7-Aug-08 2:54
Memberleppie7-Aug-08 2:54 
GeneralRe: pop3 encoding problems Pin
GeorgeBerry7-Aug-08 3:00
MemberGeorgeBerry7-Aug-08 3:00 
GeneralRe: pop3 encoding problems Pin
leppie7-Aug-08 3:04
Memberleppie7-Aug-08 3:04 

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.