Bug 771266 - Inline nsCOMPtr_base's destructor; r=jlebar
authorEhsan Akhgari <ehsan@mozilla.com>
Thu, 05 Jul 2012 15:12:13 -0400
changeset 103237 b84af5d0c13c73da78aa54439326589e9d3ab3dd
parent 103236 e5248b32d1b6ece115548982e909799739e5b5a5
child 103238 76e0145803ba97a87db7b0f0c9e918efe0f7240b
push id1316
push userakeybl@mozilla.com
push dateMon, 27 Aug 2012 22:37:00 +0000
treeherdermozilla-beta@db4b09302ee2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlebar
bugs771266
milestone16.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 771266 - Inline nsCOMPtr_base's destructor; r=jlebar
xpcom/glue/nsCOMPtr.cpp
xpcom/glue/nsCOMPtr.h
--- a/xpcom/glue/nsCOMPtr.cpp
+++ b/xpcom/glue/nsCOMPtr.cpp
@@ -36,23 +36,16 @@ nsQueryInterfaceWithError::operator()( c
 		else
 			status = NS_ERROR_NULL_POINTER;
 		
 		if ( mErrorPtr )
 			*mErrorPtr = status;
 		return status;
 	}
 
-nsCOMPtr_base::~nsCOMPtr_base()
-	{
-	  NSCAP_LOG_RELEASE(this, mRawPtr);
-		if ( mRawPtr )
-			NSCAP_RELEASE(this, mRawPtr);
-	}
-
 void
 nsCOMPtr_base::assign_with_AddRef( nsISupports* rawPtr )
 	{
     if ( rawPtr )
     	NSCAP_ADDREF(this, rawPtr);
     assign_assuming_AddRef(rawPtr);
 	}
 
--- a/xpcom/glue/nsCOMPtr.h
+++ b/xpcom/glue/nsCOMPtr.h
@@ -396,17 +396,22 @@ nsCOMPtr_base
     public:
 
       nsCOMPtr_base( nsISupports* rawPtr = 0 )
           : mRawPtr(rawPtr)
         {
           // nothing else to do here
         }
 
-      NS_COM_GLUE NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base();
+      NS_COM_GLUE NS_CONSTRUCTOR_FASTCALL ~nsCOMPtr_base()
+        {
+          NSCAP_LOG_RELEASE(this, mRawPtr);
+            if ( mRawPtr )
+              NSCAP_RELEASE(this, mRawPtr);
+        }
 
       NS_COM_GLUE void NS_FASTCALL   assign_with_AddRef( nsISupports* );
       NS_COM_GLUE void NS_FASTCALL   assign_from_qi( const nsQueryInterface, const nsIID& );
       NS_COM_GLUE void NS_FASTCALL   assign_from_qi_with_error( const nsQueryInterfaceWithError&, const nsIID& );
       NS_COM_GLUE void NS_FASTCALL   assign_from_gs_cid( const nsGetServiceByCID, const nsIID& );
       NS_COM_GLUE void NS_FASTCALL   assign_from_gs_cid_with_error( const nsGetServiceByCIDWithError&, const nsIID& );
       NS_COM_GLUE void NS_FASTCALL   assign_from_gs_contractid( const nsGetServiceByContractID, const nsIID& );
       NS_COM_GLUE void NS_FASTCALL   assign_from_gs_contractid_with_error( const nsGetServiceByContractIDWithError&, const nsIID& );