Re: FTP and callback cleanups

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Fri, 7 Mar 2003 00:07:56 +0100

On Thursday 06 March 2003 20.41, Robert Collins wrote:

> Why? Cbdata is used for handing off to async calls. All such calls
> should check for cbdataReferenceValid() before accessing the handed
> off data, and it will be invalid --- no problem.

It is also used in a couple of cases where there is combined
refcounting and cbdata for the same structure.

> > In C++ the cbdataFree handler should be called before delete.
>
> Yes - in fact, in C++ it becomes the destructor
> (FtpStateData::~FtpStateData in this case).

From what I can tell in the code the situation today is the reverse..
cbdataFree called by the delete operator.

> Why do we need to defer the delete? That sounds like reference
> counting, which is very different need to callback protection.

You are probably correct if cbdata and refcounting can be combined
cleanly for the same object in such way that delete is deferred while
there is refcounted references but not if there only is cbdata
references.

Regards
Henrik
Received on Thu Mar 06 2003 - 16:04:54 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:31 MST