From: Ian Campbell Subject: Re: [PATCH 12/13] libxl: New API for providing OS events to libxl Date: Tue, 6 Dec 2011 09:48:17 +0000 Message-ID: <1323164897.23681.27.camel@zakaz.uk.xensource.com> References: <1322499580-2322-1-git-send-email-ian.jackson@eu.citrix.com> <1322499580-2322-13-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1322499580-2322-13-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Mon, 2011-11-28 at 16:59 +0000, Ian Jackson wrote: > @@ -89,10 +99,25 @@ int libxl_ctx_alloc(libxl_ctx **pctx, int version, > > int libxl_ctx_free(libxl_ctx *ctx) > { > + int i; > + GC_INIT(ctx); You never call GC_FREE in this function. It's a bit of an odd one to need in the free function I guess but I think you still need it after the last call to a function which takes a gc argument? > + > if (!ctx) return 0; > + > + for (i = 0; i < ctx->watch_nslots; i++) > + assert(!libxl__watch_slot_contents(gc, i)); > + libxl__ev_fd_deregister(gc, &ctx->watch_efd); > + > + assert(LIBXL_LIST_EMPTY(&ctx->efds)); > + assert(LIBXL_TAILQ_EMPTY(&ctx->etimes)); Am I right that libxl__ev_fd_deregister is what ensures this is the case? If not then who is responsible for unregistering akk events before freeing a context? I've just seen you've reposted the series so I'll stop here and pickup in the repost instead. Ian.