qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] qemu-char issues (was Re: [PULL 00/15] vhost, pc: fixes


From: Peter Maydell
Subject: Re: [Qemu-devel] qemu-char issues (was Re: [PULL 00/15] vhost, pc: fixes for
Date: Thu, 26 Nov 2015 17:38:57 +0000

On 26 November 2015 at 17:01, Michael S. Tsirkin <address@hidden> wrote:
> Last note:
> https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#mainloop-memory-management
> suggests two ways to manage memory for sources.
> We seem to do neither, opting for a different approach.

We seem to pretty much be using what that doc calls the "preferred
approach": we record the tag we get back from g_source_attach
(this happens in io_add_watch_poll()).  Then on object destruction
we call remove_fd_in_watch() with that tag, which calls
io_remove_watch_poll(), which does a g_source_destroy(). And
it looks like g_source_destroy() is the "works on any GMainContext"
version of g_source_remove().

So I guess the question is: when this bug happens, have we
called g_source_destroy() before we got the callback from
glib, or is the problem that we didn't actually call
g_source_destroy() on everything we should have as part
of the destructor?

It's getting a bit late here now but I can have a look at
this tomorrow if nobody else gets there first.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]