For some unclear reason to me, char-file does not have chr_free on
win32. Since we want to switch to instance finalizer instead of class
chr_free, we should be able to run the base WinChardev class finalizer
in any case. Use a boolean to skip free to ease the transition to
instance finalizer.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
/* Protected by the Chardev chr_write_lock. */
OVERLAPPED osend;
+ /* FIXME: file/console do not finalize */
+ bool skip_free;
} WinChardev;
#define TYPE_CHARDEV_WIN "chardev-win"
{
WinChardev *s = WIN_CHARDEV(chr);
+ if (s->skip_free) {
+ return;
+ }
+
if (s->hsend) {
CloseHandle(s->hsend);
s->hsend = NULL;
{
WinChardev *s = WIN_CHARDEV(chr);
+ s->skip_free = true;
s->hcom = fd_out;
}
ChardevClass *cc = CHARDEV_CLASS(oc);
cc->open = qemu_chr_open_win_con;
- cc->chr_free = NULL;
}
static const TypeInfo char_console_type_info = {
ChardevClass *cc = CHARDEV_CLASS(oc);
cc->open = qmp_chardev_open_file;
-#ifdef _WIN32
- /* FIXME: no chr_free */
- cc->chr_free = NULL;
-#endif
}
static const TypeInfo char_file_type_info = {