[Gtk-sharp-list] Agressive ref-couting.

Mike Kestner mkestner@ximian.com
11 Sep 2002 17:16:01 -0500


On Wed, 2002-09-11 at 00:07, Miguel de Icaza wrote:

>    The following patch makes mPhoto work again, when GC happens, we are
> destroying objects that we did not ref previously.

I'm not sure this is the solution.  We shouldn't need to ref every
object, because we should own the vast majority of handles that are
returned by native methods.  Is this a situation where you are using
methods with "const" returns in the native library?

If so, we need to mark those methods in the XML and add the small piece
to the generator to handle this.  If not, then I'm stumped as to what
may be going on.  I'm not opposed to committing this patch as a stopgap
if a better solution isn't at hand. But a bug needs to be opened to
document the problem.  If we take a ref, and then release it in Dispose,
we still aren't going to be releasing most resources.

-- 
Mike Kestner <mkestner@ximian.com>