[xpcom] Add a ref when handing out the value in DataCarrier
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:44:47 +0000 (08:44 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 05:44:47 +0000 (08:44 +0300)
xpcom-dbusservice/DBusDataCarrier.cpp

index 563240dc974c4f3d6c251fd5e2ed69ede84b1f84..68e04f60423c173485ce5a3673b25861f192ea55 100644 (file)
@@ -78,7 +78,8 @@ NS_IMETHODIMP DBusDataCarrier::SetSignature(const nsACString & aSignature)
 NS_IMETHODIMP DBusDataCarrier::GetValue(nsIVariant * *aValue)
 {
     BDBLOG(("%s\n", __FUNCTION__));
-    *aValue = mValue;
+    *aValue = mValue.get();
+    NS_IF_ADDREF(*aValue);
     return NS_OK;
 }
 NS_IMETHODIMP DBusDataCarrier::SetValue(nsIVariant * aValue)