VirtualBox

Changeset 22700 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Sep 2, 2009 10:05:23 AM (15 years ago)
Author:
vboxsync
Message:

Main: comptr logging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/ptr.h

    r22305 r22700  
    6767#include <VBox/com/assert.h>
    6868
     69namespace com
     70{
     71    #define LOGREF(pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));
     72    void LogRef(const char *pcszFormat, ...);
     73}
     74
    6975/**
    7076 *  Strong referencing operators. Used as a second argument to ComPtr<>/ComObjPtr<>.
     
    7581protected:
    7682
    77     static void addref (C *p) { p->AddRef(); }
    78     static void release (C *p) { p->Release(); }
     83    static void addref(C *p)
     84    {
     85        size_t cRefs = p->AddRef();
     86        LOGREF(p, cRefs);
     87    }
     88    static void release(C *p)
     89    {
     90        p->Release();
     91    }
    7992};
    8093
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette