Click here to Skip to main content
15,669,693 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to implement a timer in Windows Service correctly? Pin
astv15-Jul-09 10:45
astv15-Jul-09 10:45 
AnswerRe: How to implement a timer in Windows Service correctly? Pin
dan!sh 15-Jul-09 6:28
professional dan!sh 15-Jul-09 6:28 
QuestionOutlook newitem event issue [modified] Pin
ghoster00715-Jul-09 5:06
ghoster00715-Jul-09 5:06 
AnswerRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 6:19
sitebuilderLuc Pattyn15-Jul-09 6:19 
GeneralRe: Outlook newitem event issue Pin
ghoster00715-Jul-09 7:00
ghoster00715-Jul-09 7:00 
GeneralRe: Outlook newitem event issue Pin
Luc Pattyn15-Jul-09 7:08
sitebuilderLuc Pattyn15-Jul-09 7:08 
GeneralRe: Outlook newitem event issue Pin
ghoster00715-Jul-09 9:08
ghoster00715-Jul-09 9:08 
QuestionUse of GC.SuppressFinalize in ref counted objects Pin
molesworth15-Jul-09 4:55
molesworth15-Jul-09 4:55 
Afternoon all,

I'm looking for advice or opinions on the best placement of GC.SuppressFinalize for reference counted objects.

The "standard" dispose pattern has the call in the public Dispose method :-

public void Dispose()
{
    Dispose(true);
    GC.SuppressFinalize(this);
}


However, for objects with reference counts I'm inclined to put it in the protected Dispose :-

protected void Dispose(bool _fulldispose)
{
    if (!m_Disposed)
    {
        if (RemoveRef() == 0)
        {
            if (_fulldispose)
            {
                GC.SuppressFinalize(this);

etc...


My reasoning is that if not all references are explicitly disposed, then the finaliser will still be needed to do the clean up. (Although in our system all objects with unmanaged components should be explicitly disposed, so that may be academic.)

There are lots of discussions about Dispose, IDisposable, SuppressFinalize etc. out on the net, but very few deal with the ref counted situation, so I'm open to any thoughts or advice...

There are three kinds of people in the world - those who can count and those who can't...

QuestionCreating four dimensional control Pin
gwithey15-Jul-09 4:32
gwithey15-Jul-09 4:32 
AnswerRe: Creating four dimensional control Pin
OriginalGriff15-Jul-09 4:49
mvaOriginalGriff15-Jul-09 4:49 
GeneralRe: Creating four dimensional control Pin
gwithey15-Jul-09 4:54
gwithey15-Jul-09 4:54 
GeneralRe: Creating four dimensional control Pin
molesworth15-Jul-09 5:12
molesworth15-Jul-09 5:12 
GeneralRe: Creating four dimensional control Pin
OriginalGriff15-Jul-09 5:26
mvaOriginalGriff15-Jul-09 5:26 
GeneralRe: Creating four dimensional control Pin
molesworth15-Jul-09 6:13
molesworth15-Jul-09 6:13 
GeneralRe: Creating four dimensional control Pin
OriginalGriff15-Jul-09 8:13
mvaOriginalGriff15-Jul-09 8:13 
QuestionHow to get the control property 'Handle' and 'Name' Pin
Durchleuchter15-Jul-09 4:12
Durchleuchter15-Jul-09 4:12 
AnswerRe: How to get the control property 'Handle' and 'Name' Pin
Dave Kreskowiak15-Jul-09 5:22
mveDave Kreskowiak15-Jul-09 5:22 
QuestionConvert HTML to RTF Pin
Sebastian T Xavier15-Jul-09 3:40
Sebastian T Xavier15-Jul-09 3:40 
AnswerRe: Convert HTML to RTF Pin
Christian Graus15-Jul-09 3:42
protectorChristian Graus15-Jul-09 3:42 
AnswerRe: Convert HTML to RTF Pin
Alan Balkany15-Jul-09 3:51
Alan Balkany15-Jul-09 3:51 
GeneralRe: Convert HTML to RTF Pin
Nagy Vilmos15-Jul-09 3:54
professionalNagy Vilmos15-Jul-09 3:54 
GeneralRe: Convert HTML to RTF Pin
Sebastian T Xavier15-Jul-09 4:02
Sebastian T Xavier15-Jul-09 4:02 
GeneralRe: Convert HTML to RTF Pin
Nagy Vilmos15-Jul-09 4:11
professionalNagy Vilmos15-Jul-09 4:11 
GeneralRe: Convert HTML to RTF Pin
Sebastian T Xavier15-Jul-09 4:23
Sebastian T Xavier15-Jul-09 4:23 
GeneralRe: Convert HTML to RTF Pin
Luc Pattyn15-Jul-09 4:11
sitebuilderLuc Pattyn15-Jul-09 4:11 

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.