Click here to Skip to main content
15,890,717 members
Home / Discussions / C#
   

C#

 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
N a v a n e e t h16-May-09 7:30
N a v a n e e t h16-May-09 7:30 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
S. Senthil Kumar16-May-09 8:47
S. Senthil Kumar16-May-09 8:47 
AnswerRe: C++ virtual destructor in C#? Why not? Pin
Mark Salsbery16-May-09 6:41
Mark Salsbery16-May-09 6:41 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
devvvy16-May-09 8:02
devvvy16-May-09 8:02 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
Mark Salsbery16-May-09 8:08
Mark Salsbery16-May-09 8:08 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
devvvy16-May-09 8:10
devvvy16-May-09 8:10 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
Mark Salsbery16-May-09 8:17
Mark Salsbery16-May-09 8:17 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
S. Senthil Kumar16-May-09 9:08
S. Senthil Kumar16-May-09 9:08 
Aren't we being a little pedantic here?

Consider a class like this
class Foo
{
   StreamReader reader;
   IntPtr handle;

   public Foo()
   {
      // Initialize reader, handle
   }
}


Now I would dispose the StreamReader and close the IntPtr handle inside Dispose(true), but will only close the handle inside Dispose(false).

I guess it boils down to whether you consider StreamReader to be a managed resource, or a managed wrapper over an unmanaged resource. I would say it is a managed resource, given that it has a Dispose/Close and a finalizer.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Home Page |My Blog | My Articles | My Flickr | WinMacro

GeneralRe: C++ virtual destructor in C#? Why not? Pin
Mark Salsbery16-May-09 9:20
Mark Salsbery16-May-09 9:20 
AnswerRe: C++ virtual destructor in C#? Why not? Pin
Guffa16-May-09 16:46
Guffa16-May-09 16:46 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
devvvy16-May-09 17:04
devvvy16-May-09 17:04 
GeneralRe: C++ virtual destructor in C#? Why not? Pin
Guffa22-May-09 13:27
Guffa22-May-09 13:27 
QuestionUse methods from another form Pin
michaelgr116-May-09 2:08
michaelgr116-May-09 2:08 
AnswerRe: Use methods from another form Pin
OriginalGriff16-May-09 2:39
mveOriginalGriff16-May-09 2:39 
AnswerRe: Use methods from another form Pin
michaelgr116-May-09 3:03
michaelgr116-May-09 3:03 
GeneralRe: Use methods from another form Pin
OriginalGriff16-May-09 3:53
mveOriginalGriff16-May-09 3:53 
AnswerRe: Use methods from another form Pin
Manas Bhardwaj16-May-09 6:20
professionalManas Bhardwaj16-May-09 6:20 
GeneralRe: Use methods from another form Pin
michaelgr116-May-09 6:33
michaelgr116-May-09 6:33 
GeneralRe: Use methods from another form Pin
Dave Kreskowiak16-May-09 17:24
mveDave Kreskowiak16-May-09 17:24 
QuestionDataGridView CellPainting Performance Issue Pin
John Jak16-May-09 2:08
John Jak16-May-09 2:08 
QuestionOCR using Abby Finereader in C# Pin
makimca16-May-09 1:33
makimca16-May-09 1:33 
AnswerRe: OCR using Abby Finereader in C# Pin
incaunu16-Jul-09 3:20
incaunu16-Jul-09 3:20 
AnswerRe: OCR using Abby Finereader in C# Pin
shparmar17-Nov-10 23:03
shparmar17-Nov-10 23:03 
Questiongraph Pin
shanmugam_1316-May-09 0:45
shanmugam_1316-May-09 0:45 
AnswerRe: graph Pin
Rajesh R Subramanian16-May-09 1:16
professionalRajesh R Subramanian16-May-09 1:16 

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.