Re: aysnc functions v. callback_data



On Fri, 2004-07-02 at 09:59 +0200, Alexander Larsson wrote:
> On Thu, 2004-07-01 at 16:54, Murray Cumming wrote:
> > It looks like the async function needs extra destroy_callbacks
> > 
> > For instance,
> > 
> > in gnome_vfs_async_open(), we would normally release the callback_data
> > when the callback is called, because we assume that the callback will
> > only be called once. But if someone calls gnome_vfs_async_cancel() then
> > the callback_data will never be released, because the callback will
> > never be called.
> > 
> > So do we need new versions of these functions?
> > 
> > http://cvs.gnome.org/viewcvs/gnome-vfs/libgnomevfs/gnome-vfs-async-ops.h?view=markup
> 
> I don't know why they weren't added when the functions were created, i
> assume people thought "well, if the user cancelled the job they might as
> well free the callback data (if they want that) at the same time". That
> does require a bit more bookkeeping on the side of the app though  (you
> need the mapping from wherever you store the outstanding handle to the
> callback data for that handle).

I thought about this, but isn't it possible to have >1 async operation
on the same handle at the same time?

> Adding it requires a lot of new functions though...

I might look at doing that, though it's scary.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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