Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 12:58
protectorChristian Graus9-Jun-05 12:58 
GeneralRe: NULL Pin
devin1239-Jun-05 13:17
devin1239-Jun-05 13:17 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 13:20
protectorChristian Graus9-Jun-05 13:20 
GeneralRe: NULL Pin
devin1239-Jun-05 13:32
devin1239-Jun-05 13:32 
GeneralRe: NULL Pin
Christian Graus9-Jun-05 13:52
protectorChristian Graus9-Jun-05 13:52 
GeneralRe: NULL Pin
devin1239-Jun-05 13:54
devin1239-Jun-05 13:54 
GeneralRe: NULL Pin
Skynyrd10-Jun-05 0:18
Skynyrd10-Jun-05 0:18 
GeneralRe: NULL Pin
Roger Alsing10-Jun-05 3:09
Roger Alsing10-Jun-05 3:09 
Here is how it works:

you have a reference to your ".net" object instance
the memory that object occupies is released by the GC when no references are left.

Dispose is used to release native resources , such as filehandles , db connections or memory allocated by some native resource.


so ".Dispose" does not kill the .net object itself , it just tells it to drop its expensive resources.

if you are working with images , eg in DX there are plenty of unmanaged resources behind the scenes , and your .net object is told to drop those directly ... therefore Christian get a big chunk of memory back.

if your object does not hold any references to any native resources (directly or inderectly) you will not gain anything by implementing idisposable on that class.

eg if your class has a big arraylist or array and you set it to null in your dispose method , you will not gain anything since those are managed resources taht will be released by the GC.


//Roger
GeneralConvert C++ #define directives to C# Pin
bynaryum9-Jun-05 11:09
bynaryum9-Jun-05 11:09 
GeneralRe: Convert C++ #define directives to C# Pin
Colin Angus Mackay9-Jun-05 12:10
Colin Angus Mackay9-Jun-05 12:10 
GeneralRe: Convert C++ #define directives to C# Pin
DavidNohejl9-Jun-05 14:45
DavidNohejl9-Jun-05 14:45 
QuestionHow to format highlighted text in textbox? Pin
Julianne_juju9-Jun-05 10:30
Julianne_juju9-Jun-05 10:30 
AnswerRe: How to format highlighted text in textbox? Pin
MoustafaS9-Jun-05 14:21
MoustafaS9-Jun-05 14:21 
GeneralRe: How to format highlighted text in textbox? Pin
Pyro Joe9-Jun-05 17:19
Pyro Joe9-Jun-05 17:19 
GeneralRe: How to format highlighted text in textbox? Pin
Julianne_juju10-Jun-05 12:33
Julianne_juju10-Jun-05 12:33 
GeneralA string thing i cannot figure out Pin
sameerhanda9-Jun-05 10:11
sameerhanda9-Jun-05 10:11 
GeneralRe: A string thing i cannot figure out Pin
Christian Graus9-Jun-05 12:20
protectorChristian Graus9-Jun-05 12:20 
GeneralRe: A string thing i cannot figure out Pin
Jack Bond13-Jun-05 2:14
Jack Bond13-Jun-05 2:14 
Questionsetting an object to null, what happens? Pin
devin1239-Jun-05 9:56
devin1239-Jun-05 9:56 
AnswerRe: setting an object to null, what happens? Pin
Colin Angus Mackay9-Jun-05 12:14
Colin Angus Mackay9-Jun-05 12:14 
GeneralRe: setting an object to null, what happens? Pin
devin1239-Jun-05 12:21
devin1239-Jun-05 12:21 
QuestionHow to reclaim the memory manually Pin
devin1239-Jun-05 9:54
devin1239-Jun-05 9:54 
AnswerRe: How to reclaim the memory manually Pin
Colin Angus Mackay9-Jun-05 12:15
Colin Angus Mackay9-Jun-05 12:15 
GeneralRe: How to reclaim the memory manually Pin
devin1239-Jun-05 12:30
devin1239-Jun-05 12:30 
GeneralRe: How to reclaim the memory manually Pin
Colin Angus Mackay9-Jun-05 12:33
Colin Angus Mackay9-Jun-05 12:33 

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.