On 07/10/2013 10:55 PM, Tom Tromey wrote: >>>>>> "Ali" == ali anwar writes: > > > This installs the cleanups at the wrong point. > They must be installed before any potential exception is thrown. > > That is, the xfree cleanup ought to be created just after initialization; > and the refcount cleanup ought to be created after the refcounts are > incremented. > > Also, make_cleanup_thread_refcount is misnamed. > By convention, a "make_cleanup_" function creates a new cleanup. > The function that does the work of cleaning up is given a different name. > Thanks for the Review. Please find attached updated patch. -Ali