locked
RTMCredentialProviderSamples__FINAL STDMETHOD_(ULONG, Release)() RRS feed

  • General discussion

  • The implementaion on COM->Release in all of the samples here seems wrong;

    All COM has this implementation.

    STDMETHOD_(ULONG, Release)()

    {

    LONG cRef = _cRef--;

    if (!cRef) {

    delete this;

    }

    return cRef;

    }

    This should be like below or the destructor will never be called.

     STDMETHOD_(ULONG, Release)()

    {

    LONG cRef = --_cRef;

    if (!cRef) {

    delete this;

    }

    return cRef;

    }

    Friday, January 19, 2007 2:01 PM