Skip to content

Commit

Permalink
char-ringbuf: convert to finalize
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
  • Loading branch information
elmarco committed Jan 31, 2017
1 parent fa943b5 commit 9fa2f7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qemu-char.c
Expand Up @@ -3550,9 +3550,9 @@ static int ringbuf_chr_read(Chardev *chr, uint8_t *buf, int len)
return i;
}

static void ringbuf_chr_free(struct Chardev *chr)
static void char_ringbuf_finalize(Object *obj)
{
RingBufChardev *d = RINGBUF_CHARDEV(chr);
RingBufChardev *d = RINGBUF_CHARDEV(obj);

g_free(d->cbuf);
}
Expand Down Expand Up @@ -3982,14 +3982,14 @@ static void char_ringbuf_class_init(ObjectClass *oc, void *data)

cc->open = qemu_chr_open_ringbuf;
cc->chr_write = ringbuf_chr_write;
cc->chr_free = ringbuf_chr_free;
}

static const TypeInfo char_ringbuf_type_info = {
.name = TYPE_CHARDEV_RINGBUF,
.parent = TYPE_CHARDEV,
.class_init = char_ringbuf_class_init,
.instance_size = sizeof(RingBufChardev),
.instance_finalize = char_ringbuf_finalize,
};

/* Bug-compatibility: */
Expand Down

0 comments on commit 9fa2f7a

Please sign in to comment.