foreignPtrToPtr
Marcin 'Qrczak' Kowalczyk
mk167280@students.mimuw.edu.pl
Thu, 14 Dec 2000 13:02:21 +0100 (CET)
On Thu, 14 Dec 2000, Simon Marlow wrote:
> > I guess this pattern might arise in other cases where a
> > subobject must not
> > be freed separately but must cause the object it is contained
> > in to live at least as long.
>
> This is really what weak pointers are for,
I don't think they can help here. I don't want to lose the row when the
bitmap dies; I want to keep the row until it is referenced, and the only
way to have this is to keep the bitmap even if it's not referenced,
because destroying the bitmap would kill the row (because the C interface
does not allow to express "free the bitmap except some its rows").
--
Marcin 'Qrczak' Kowalczyk