Index: /trunk/include/VBox/com/ptr.h
===================================================================
--- /trunk/include/VBox/com/ptr.h	(revision 22701)
+++ /trunk/include/VBox/com/ptr.h	(revision 22702)
@@ -69,5 +69,5 @@
 namespace com
 {
-    #define LOGREF(pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));
+    #define LOGREF(prefix, pObj, cRefs) com::LogRef(#pObj "{%p}.refCnt=%d\n", (pObj), (cRefs));
     void LogRef(const char *pcszFormat, ...);
 }
@@ -84,8 +84,10 @@
     {
         size_t cRefs = p->AddRef();
-        LOGREF(p, cRefs);
+        LOGREF("ADDREF ", p, cRefs);
     }
     static void release(C *p)
     {
+        size_t cRefs = p->Release();
+        LOGREF("RELEASE ", p, cRefs);
         p->Release();
     }
Index: /trunk/src/VBox/Main/glue/com.cpp
===================================================================
--- /trunk/src/VBox/Main/glue/com.cpp	(revision 22701)
+++ /trunk/src/VBox/Main/glue/com.cpp	(revision 22702)
@@ -48,8 +48,8 @@
 #include <iprt/env.h>
 #include <iprt/string.h>
-#include <iprt/log.h>
 
 #include <VBox/err.h>
 
+#include <Logging.h>
 
 #ifdef RT_OS_DARWIN
@@ -208,12 +208,11 @@
 void LogRef(const char *pcszFormat, ...)
 {
-    va_list va;
-    va_start(va, pcszFormat);
-    va_end(va);
-
-    char *psz = NULL;
-    RTStrAPrintfV(&psz, pcszFormat, va);
-    LogDJ((psz));
-    RTStrFree(psz);
+    char *pszNewMsg;
+    va_list args;
+    va_start(args, pcszFormat);
+    RTStrAPrintfV(&pszNewMsg, pcszFormat, args);
+    LogDJ((pszNewMsg));
+    RTStrFree(pszNewMsg);
+    va_end(args);
 }
 
