Re: [RFC 06/11] aio: free AioContext when aio_context_new() fails

2025-06-05 Thread Stefan Hajnoczi
On Wed, May 28, 2025 at 04:06:13PM -0500, Eric Blake wrote: > On Wed, May 28, 2025 at 03:09:11PM -0400, Stefan Hajnoczi wrote: > > g_source_destroy() only removes the GSource from the GMainContext it's > > attached to, if any. It does not free it. > > > > Use g_source_unref() instead so that the A

Re: [RFC 06/11] aio: free AioContext when aio_context_new() fails

2025-05-28 Thread Eric Blake
On Wed, May 28, 2025 at 03:09:11PM -0400, Stefan Hajnoczi wrote: > g_source_destroy() only removes the GSource from the GMainContext it's > attached to, if any. It does not free it. > > Use g_source_unref() instead so that the AioContext (which embeds a > GSource) is freed. There is no need to cal

[RFC 06/11] aio: free AioContext when aio_context_new() fails

2025-05-28 Thread Stefan Hajnoczi
g_source_destroy() only removes the GSource from the GMainContext it's attached to, if any. It does not free it. Use g_source_unref() instead so that the AioContext (which embeds a GSource) is freed. There is no need to call g_source_destroy() in aio_context_new() because the GSource isn't attache