Re: [Re: [Re: gobject weak references]]
- From: Alex Larsson <alexl redhat com>
- To: Dave Benson <daveb idealab com>
- Cc: Murray Cumming <murrayc usa net>, Sven Neumann <sven gimp org>, <gtk-devel-list gnome org>
- Subject: Re: [Re: [Re: gobject weak references]]
- Date: Tue, 18 Sep 2001 12:48:59 -0400 (EDT)
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]