[pulseaudio-commits] r1495 - /branches/lennart/src/pulsecore/asyncmsgq.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Jun 24 09:11:53 PDT 2007


Author: lennart
Date: Sun Jun 24 18:11:52 2007
New Revision: 1495

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1495&root=3Dpulseaudio&vi=
ew=3Drev
Log:
Make sure the returned pa_msgobject object has a valid refcnt before return=
ing it

Modified:
    branches/lennart/src/pulsecore/asyncmsgq.c

Modified: branches/lennart/src/pulsecore/asyncmsgq.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/pulsecore/=
asyncmsgq.c?rev=3D1495&root=3Dpulseaudio&r1=3D1494&r2=3D1495&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- branches/lennart/src/pulsecore/asyncmsgq.c (original)
+++ branches/lennart/src/pulsecore/asyncmsgq.c Sun Jun 24 18:11:52 2007
@@ -153,18 +153,24 @@
     pa_assert(code);
     pa_assert(!a->current);
 =

-    if (!(a->current =3D pa_asyncq_pop(a->asyncq, wait)))
+    if (!(a->current =3D pa_asyncq_pop(a->asyncq, wait))) {
+/*         pa_log("failure"); */
         return -1;
+    }
+
+/*     pa_log("success"); */
 =

     *code =3D a->current->code;
     if (userdata)
         *userdata =3D a->current->userdata;
-    if (object)
-        *object =3D a->current->object;
+    if (object) {
+        if ((*object =3D a->current->object))
+            pa_msgobject_assert_ref(*object);
+    }
     if (chunk)
         *chunk =3D a->current->memchunk;
 =

-    pa_log_debug("q=3D%p object=3D%p (%s) code=3D%i data=3D%p chunk.length=
=3D%u", (void*) a, (void*) a->current->object, a->current->object ? a->curr=
ent->object->parent.type_name : NULL, a->current->code, (void*) a->current-=
>userdata, a->current->memchunk.length);
+    pa_log_debug("Get q=3D%p object=3D%p (%s) code=3D%i data=3D%p chunk.le=
ngth=3D%u", (void*) a, (void*) a->current->object, a->current->object ? a->=
current->object->parent.type_name : NULL, a->current->code, (void*) a->curr=
ent->userdata, a->current->memchunk.length);
     =

     return 0;
 }




More information about the pulseaudio-commits mailing list