]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virnetsocket: Revert part of g_steal_pointer() rewrite
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 24 Mar 2021 15:49:39 +0000 (16:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 26 Mar 2021 09:11:57 +0000 (10:11 +0100)
Turns out, the way that glib implements g_steal_pointer() is not
compatible with function callbacks. And that's what my recent
patch did in virNetSocketEventFree(). Revert that part.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/rpc/virnetsocket.c

index 5675c0769d294c5a02bf033968adcbc12ccf8738..b1f47636d187c07d7964b601d2bf5c962e8f8b46 100644 (file)
@@ -2156,9 +2156,10 @@ static void virNetSocketEventFree(void *opaque)
     void *eopaque;
 
     virObjectLock(sock);
-    ff = g_steal_pointer(&sock->ff);
+    ff = sock->ff;
     eopaque = g_steal_pointer(&sock->opaque);
     sock->func = NULL;
+    sock->ff = NULL;
     virObjectUnlock(sock);
 
     if (ff)