Click here to Skip to main content
15,898,849 members
Home / Discussions / C#
   

C#

 
QuestionWindows Appearance settings mess with Window Sizes Pin
JKrigelman14-Aug-08 14:27
JKrigelman14-Aug-08 14:27 
AnswerRe: Windows Appearance settings mess with Window Sizes Pin
JKrigelman15-Aug-08 6:20
JKrigelman15-Aug-08 6:20 
QuestionAutomatically cleanup of "managed resources" when object dies Pin
invictus314-Aug-08 13:45
invictus314-Aug-08 13:45 
AnswerRe: Automatically cleanup of "managed resources" when object dies Pin
Mark Churchill14-Aug-08 14:16
Mark Churchill14-Aug-08 14:16 
AnswerRe: Automatically cleanup of "managed resources" when object dies Pin
AhsanS14-Aug-08 22:28
AhsanS14-Aug-08 22:28 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
invictus315-Aug-08 0:39
invictus315-Aug-08 0:39 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
AhsanS15-Aug-08 1:02
AhsanS15-Aug-08 1:02 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
invictus315-Aug-08 1:15
invictus315-Aug-08 1:15 
Ok, thanks.

However, this is not without pain. It seems like by saying:

using(someobj = new someclass()) {}

the Dispose method will be called, while doing:

someobj = null;

will NOT trigger the Dispose method. Does this mean that if I want to manually force the memory management to deal with it I have to say:

someobj.Dispose();
someobj = null;

In that case, just making a Close method where I close all resources manually seems a lot easier in the short run, since the whole point of my post was to avoid such manual labor in an attempt to release all resources automatically.

Although the GC will "eventually" trigger the destructor when just kicking the objekt out of scope, this seems a bit weird since I have not been able to release files in the destructor without exceptions saying there are none.
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
AhsanS15-Aug-08 1:43
AhsanS15-Aug-08 1:43 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
invictus316-Aug-08 3:10
invictus316-Aug-08 3:10 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
Scott Dorman16-Aug-08 5:16
professionalScott Dorman16-Aug-08 5:16 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
invictus316-Aug-08 6:20
invictus316-Aug-08 6:20 
GeneralRe: Automatically cleanup of "managed resources" when object dies Pin
Scott Dorman16-Aug-08 7:04
professionalScott Dorman16-Aug-08 7:04 
AnswerRe: Automatically cleanup of "managed resources" when object dies Pin
invictus320-Aug-08 11:17
invictus320-Aug-08 11:17 
QuestionGoogle Contacts API fails with 403 Forbidden Always Pin
Vasudevan Deepak Kumar14-Aug-08 8:32
Vasudevan Deepak Kumar14-Aug-08 8:32 
QuestionStatic objects and terminal server Pin
fredsparkle14-Aug-08 6:45
fredsparkle14-Aug-08 6:45 
AnswerRe: Static objects and terminal server Pin
Manas Bhardwaj14-Aug-08 6:47
professionalManas Bhardwaj14-Aug-08 6:47 
GeneralRe: Static objects and terminal server Pin
fredsparkle14-Aug-08 6:55
fredsparkle14-Aug-08 6:55 
AnswerRe: Static objects and terminal server Pin
S. Senthil Kumar14-Aug-08 21:03
S. Senthil Kumar14-Aug-08 21:03 
QuestionMoving or deleting files failing Pin
Ekjon14-Aug-08 6:37
Ekjon14-Aug-08 6:37 
AnswerRe: Moving or deleting files failing Pin
Manas Bhardwaj14-Aug-08 6:40
professionalManas Bhardwaj14-Aug-08 6:40 
AnswerRe: Moving or deleting files failing Pin
Le centriste14-Aug-08 6:46
Le centriste14-Aug-08 6:46 
GeneralRe: Moving or deleting files failing Pin
Ekjon14-Aug-08 7:31
Ekjon14-Aug-08 7:31 
QuestionPopulating a combobox from a collection Pin
Jonso14-Aug-08 5:47
Jonso14-Aug-08 5:47 
AnswerRe: Populating a combobox from a collection Pin
Giorgi Dalakishvili14-Aug-08 5:58
mentorGiorgi Dalakishvili14-Aug-08 5:58 

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.