VirtualBox

Changeset 22702 in vbox


Ignore:
Timestamp:
Sep 2, 2009 10:16:24 AM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51819
Message:

Main: comptr logging

Location:
trunk
Files:
2 edited

Legend:

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

    r22700 r22702  
    6969namespace com
    7070{
    71     #define LOGREF(pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));
     71    #define LOGREF(prefix, pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));
    7272    void LogRef(const char *pcszFormat, ...);
    7373}
     
    8484    {
    8585        size_t cRefs = p->AddRef();
    86         LOGREF(p, cRefs);
     86        LOGREF("ADDREF ", p, cRefs);
    8787    }
    8888    static void release(C *p)
    8989    {
     90        size_t cRefs = p->Release();
     91        LOGREF("RELEASE ", p, cRefs);
    9092        p->Release();
    9193    }
  • trunk/src/VBox/Main/glue/com.cpp

    r22700 r22702  
    4848#include <iprt/env.h>
    4949#include <iprt/string.h>
    50 #include <iprt/log.h>
    5150
    5251#include <VBox/err.h>
    5352
     53#include <Logging.h>
    5454
    5555#ifdef RT_OS_DARWIN
     
    208208void LogRef(const char *pcszFormat, ...)
    209209{
    210     va_list va;
    211     va_start(va, pcszFormat);
    212     va_end(va);
    213 
    214     char *psz = NULL;
    215     RTStrAPrintfV(&psz, pcszFormat, va);
    216     LogDJ((psz));
    217     RTStrFree(psz);
     210    char *pszNewMsg;
     211    va_list args;
     212    va_start(args, pcszFormat);
     213    RTStrAPrintfV(&pszNewMsg, pcszFormat, args);
     214    LogDJ((pszNewMsg));
     215    RTStrFree(pszNewMsg);
     216    va_end(args);
    218217}
    219218
Note: See TracChangeset for help on using the changeset viewer.

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