Re: [anjuta-devel] New project interface and introspection

Hello Sébastien,

Sorry for not answering your previous mail, I was too busy.

              في ر، 22-09-2010 عند 22:02 +0200 ، كتب Sébastien Granjoux:
Hi Abderrahim,

I have changed the AnjutaProjectNode to use GObject, it's working but 
there are two issues.

1. In C, when you create a node you get a reference to it and when you 
add it in the project, the parent increment the reference count too. So 
you need to call g_object_unref after inserting each node in the project 
which is the most common operation. I have thought to use floating 
reference, but I'm afraid I have to use some uncommon functions those 
will not be fully supported. In Python, it doesn't matter because the 
call to g_object_unref is done automatically.
Both Gtk and Clutter use floating references. So there shouldn't be a
problem with them. However, I see that you're calling
g_object_force_floating which is dangerous (and potentially wrong).
I feel that it should be a unref there (not sure though).

2. Reloading a node is done in a different thread. To avoid accessing 
the same object from a different thread, before loading the node, I 
remove it from the project tree replacing it with a dummy node and pass 
the original node to the loading function. But if some other piece of 
code has kept a reference on the original node, it is possible that both 
the worker thread and this code use the same object. So, it's quite 
dangerous to get a reference on a node object anyway.
That's right, but who would want to keep a reference anyway? I think
it's not a problem, but if we find a use to keeping node references
around, we can add a new signal so anyone having a reference can use the
reference to the proxy or drop the reference altogether.


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