From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tXJ-0002JC-83 for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X1tXD-0000rT-2T for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:33 -0400 Received: from mail-we0-x232.google.com ([2a00:1450:400c:c03::232]:40424) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X1tXC-0000rI-IF for qemu-devel@nongnu.org; Tue, 01 Jul 2014 04:35:26 -0400 Received: by mail-we0-f178.google.com with SMTP id x48so9214586wes.9 for ; Tue, 01 Jul 2014 01:35:25 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 1 Jul 2014 10:34:55 +0200 Message-Id: <1404203705-15674-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1404203705-15674-1-git-send-email-pbonzini@redhat.com> References: <1404203705-15674-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 05/15] qom: object: remove parent pointer when unparenting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Crosthwaite From: Peter Crosthwaite Certain parts of the QOM framework test this pointer to determine if an object is parented. Nuke it when the object is unparented to allow for reuse of an object after unparenting. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- qom/object.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/object.c b/qom/object.c index f49335f..d5de8f6 100644 --- a/qom/object.c +++ b/qom/object.c @@ -397,6 +397,7 @@ void object_unparent(Object *obj) } if (obj->parent) { object_property_del_child(obj->parent, obj, NULL); + obj->parent = NULL; } object_unref(obj); } -- 1.8.3.1