[xpcom] Change the target pointer of NS_ADDREF() to match that of the
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 27 Aug 2009 05:53:32 +0000 (08:53 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 27 Aug 2009 05:53:32 +0000 (08:53 +0300)
corresponding NS_RELEASE(). This seems to cause build problems in some
configurations. Patch by Charlie Lenahan.

xpcom-dbusservice/DBusMarshaling.cpp
xpcom-dbusservice/DBusMethod.cpp
xpcom-dbusservice/DBusService.cpp

index cfbaa9a..48e9fb4 100644 (file)
@@ -1307,7 +1307,7 @@ already_AddRefed<nsIWritableVariant> getVariantFromIter(JSContext* cx, DBusMessa
                 {
                     nsCOMPtr<nsIVariant> item = do_QueryElementAt(items, i);
                     item_array[i] = item;
-                    NS_ADDREF(item);
+                    NS_ADDREF(item_array[i]);
                 }
                 variant->SetAsArray(nsIDataType::VTYPE_INTERFACE_IS,
                                     &NS_GET_IID(nsIVariant),
@@ -1349,7 +1349,7 @@ already_AddRefed<nsIWritableVariant> getVariantFromIter(JSContext* cx, DBusMessa
             {
                 nsCOMPtr<nsIVariant> item = do_QueryElementAt(items, i);
                 item_array[i] = item;
-                NS_ADDREF(item);
+                NS_ADDREF(item_array[i]);
             }
             variant->SetAsArray(nsIDataType::VTYPE_INTERFACE_IS,
                                 &NS_GET_IID(nsIVariant),
index 3afb3e5..96212a8 100644 (file)
@@ -221,7 +221,7 @@ DoCallBack(DBusMethod *aMethod, DBusMessage *aReply)
         {
             nsCOMPtr<nsIVariant> arg = do_QueryElementAt(reply_args, i);
             callback_args[i] = arg;
-            NS_ADDREF(arg);
+            NS_ADDREF(callback_args[i]);
         }
         args->SetAsArray(nsIDataType::VTYPE_INTERFACE_IS,
                          &NS_GET_IID(nsIVariant),
index 51fef8c..fd13126 100644 (file)
@@ -391,7 +391,7 @@ DBusHandlerResult _signal_filter(DBusConnection *connection,
             {
                 nsCOMPtr<nsIVariant> arg = do_QueryElementAt(args_array, i);
                 callback_args[i] = arg;
-                NS_ADDREF(arg);
+                NS_ADDREF(callback_args[i]);
             }
             args->SetAsArray(nsIDataType::VTYPE_INTERFACE_IS,
                              &NS_GET_IID(nsIVariant),