On Tue, 2008-04-08 at 20:46 +0300, Tsantilas Christos wrote: > Henrik Nordstrom wrote: > > So any proposals on how we would go about fixing comm_read_cancel? > > > > Hmm.. on reading that code commio_cancel_callback looks a bit odd in > > trunk. Why is callback set to NULL twice, and what is really the purpose > > of this function now that the actual callback is in an AsyncCall..? > > AsyncCalls are refcounted so believed that with "ccb->callback = NULL" > the AsyncCall which the ccb->callback point released. But yes if it is > refcounted by an other object (for example in AsyncCalls queues,....) > it is not released and remains active. Looks that this is the bug.
Yes, forgetting about a callback (i.e., assigning NULL to a pointer) is not the same as canceling it. If the code meant to cancel the callback, it should have called the cancel method and then set the pointer to NULL. This is exactly what Henrik's patch does. BTW, if somebody commits that patch, please polish the reason phrase in the cancel() call to something more specific. Thank you, Alex.
