From 1566b0c455c18b2bc3561368f9e9eed5089815eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 8 Dec 2016 19:29:35 +0300 Subject: [PATCH] char-win-stdio: convert to finalize MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Reviewed-by: Eric Blake --- qemu-char.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 390e6a99de..d92642735e 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -2594,9 +2594,9 @@ static void qemu_chr_set_echo_win_stdio(Chardev *chr, bool echo) } } -static void win_stdio_free(Chardev *chr) +static void char_win_stdio_finalize(Object *obj) { - WinStdioChardev *stdio = WIN_STDIO_CHARDEV(chr); + WinStdioChardev *stdio = WIN_STDIO_CHARDEV(obj); if (stdio->hInputReadyEvent != INVALID_HANDLE_VALUE) { CloseHandle(stdio->hInputReadyEvent); @@ -2613,6 +2613,7 @@ static const TypeInfo char_win_stdio_type_info = { .name = TYPE_CHARDEV_WIN_STDIO, .parent = TYPE_CHARDEV, .instance_size = sizeof(WinStdioChardev), + .instance_finalize = char_win_stdio_finalize, .abstract = true, }; @@ -3856,7 +3857,6 @@ static void char_stdio_class_init(ObjectClass *oc, void *data) #ifdef _WIN32 cc->chr_write = win_stdio_write; cc->chr_set_echo = qemu_chr_set_echo_win_stdio; - cc->chr_free = win_stdio_free; #else cc->chr_set_echo = qemu_chr_set_echo_stdio; #endif