Re: [Re: [Re: gobject weak references]]



On Tue, 18 Sep 2001, Dave Benson wrote:

> On Tue, Sep 18, 2001 at 05:10:21PM +0100, Murray Cumming wrote:
> > I wouldn't like an API to encourage the use of invalid pointers because that
> > increases the chance of segfaults.
> 
> worse, if the memory has been freed then its possible
> that its possible that another will get the same memory
> address.  so if you're using it as a key in a hash-table,
> you could get a collision if the memory was freed before
> the finalize hooks.

Only if you're allocating something and adding to the hash table from a
weak ref destroy notifier. 

Hmmm. I guess it could turn up if you're using threads too... That would 
need to be solved by a lock.

/ Alex






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