Click here to Skip to main content
15,917,539 members
Home / Discussions / C#
   

C#

 
AnswerRe: Import Excal file into Mysql Pin
dan!sh 5-May-09 19:26
professional dan!sh 5-May-09 19:26 
AnswerRe: Import Excal file into Mysql Pin
Mycroft Holmes5-May-09 20:08
professionalMycroft Holmes5-May-09 20:08 
QuestionC# Globalhook(WH_CALLWNDPROC) Pin
hongkunjiang5-May-09 17:59
hongkunjiang5-May-09 17:59 
AnswerRe: C# Globalhook(WH_CALLWNDPROC) Pin
stancrm5-May-09 20:40
stancrm5-May-09 20:40 
GeneralRe: C# Globalhook(WH_CALLWNDPROC) Pin
hongkunjiang5-May-09 21:23
hongkunjiang5-May-09 21:23 
AnswerRe: C# Globalhook(WH_CALLWNDPROC) Pin
S. Senthil Kumar6-May-09 9:33
S. Senthil Kumar6-May-09 9:33 
QuestionPolygon Rendering Performance Optimization Pin
StarBP5-May-09 16:50
StarBP5-May-09 16:50 
QuestionI want to know Pin
dileeparuwan5-May-09 16:32
dileeparuwan5-May-09 16:32 
AnswerRe: I want to know Pin
Christian Graus5-May-09 16:57
protectorChristian Graus5-May-09 16:57 
GeneralRe: I want to know Pin
dileeparuwan5-May-09 21:39
dileeparuwan5-May-09 21:39 
QuestionHow to select && or || within formula at run time Pin
MAW305-May-09 16:32
MAW305-May-09 16:32 
Questionodbc firebird C# Pin
mark_me5-May-09 16:03
mark_me5-May-09 16:03 
AnswerRe: odbc firebird C# Pin
Giorgi Dalakishvili5-May-09 20:03
mentorGiorgi Dalakishvili5-May-09 20:03 
QuestionEasy way to create a save/load functionality to an Application Pin
sodevrom5-May-09 13:47
sodevrom5-May-09 13:47 
AnswerRe: Easy way to create a save/load functionality to an Application Pin
Dave Kreskowiak5-May-09 17:23
mveDave Kreskowiak5-May-09 17:23 
QuestionWinForms Comboboxes Pin
Illegal Operation5-May-09 13:32
Illegal Operation5-May-09 13:32 
AnswerRe: WinForms Comboboxes Pin
dotnetmember5-May-09 16:42
dotnetmember5-May-09 16:42 
AnswerRe: WinForms Comboboxes Pin
Mycroft Holmes5-May-09 17:24
professionalMycroft Holmes5-May-09 17:24 
QuestionTo Dispose() or not Dispose(), that is the question. Pin
Peter Trevor5-May-09 13:02
Peter Trevor5-May-09 13:02 
AnswerRe: To Dispose() or not Dispose(), that is the question. Pin
Luc Pattyn5-May-09 13:25
sitebuilderLuc Pattyn5-May-09 13:25 
GeneralRe: To Dispose() or not Dispose(), that is the question. Pin
fly9045-May-09 14:22
fly9045-May-09 14:22 
GeneralRe: To Dispose() or not Dispose(), that is the question. Pin
Luc Pattyn5-May-09 14:47
sitebuilderLuc Pattyn5-May-09 14:47 
fly904 wrote:
Would setting it to null do/be the same?


setting a reference to null removes one reference to some object. If that happened to be the last live reference, the object becomes collectable, which does not free any memory yet, since the GC has to run first to discover that. And it does not close a file, does not free other managed resources, and does not free any unmanaged resources, say memory that got malloced in native code, will not get freed ever if there is no Dispose(); BTW: Windows will clean up everything when the process exits.

If a Dispose exists but is not called by your code, it will get called by the GC when the object gets finalized, which may be much later. Do you want to keep the large memory footprint longer than necessary, do you want to keep files open longer then necessary, ...? I don't think so.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


JokeRe: To Dispose() or not Dispose(), that is the question. Pin
fly9045-May-09 15:24
fly9045-May-09 15:24 
GeneralRe: To Dispose() or not Dispose(), that is the question. Pin
Luc Pattyn5-May-09 15:42
sitebuilderLuc Pattyn5-May-09 15:42 
QuestionExpose Property of Constituent Control in UserControl Pin
xfitr25-May-09 11:18
xfitr25-May-09 11:18 

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.