Fly-by-night clandestine removal of refcount check! Aroooga!




Elliot,

    I have just noticed that, in your goad_id patch of December 9th,
you sneakily removed an important check from
bonobo_object_add_interface.  To quote the ChangeLog:

	* bonobo/gnome-object.c: Remove over-strict checking of
          refcounts in add_interface().

The check that you removed is below, including the explanatory
comment, which you accidentally left in:

       /*
	* Explanation:
	*   Bonobo Objects should not be assembled after they have been
	*   exposed, or we would be breaking the contract we have with
	*   the other side.
	*
	*   This check is not perfect, but might help some people.
	*/
       g_return_if_fail (object->priv->ao->ref_count == 1);
       g_return_if_fail (newobj->priv->ao->ref_count == 1);

First, you really should have discussed this change on the mailing
list before committing it.  Second, I think the checks should stay in
there.

    Those checks ensure that the objects which are being aggregated
have never before been exported to client code.  The intent was to
enforce the invariant that interfaces are never added to an aggregate
object after the object has been put to use by a client.  Since QI
implicity refs the object, we can rely on these checks to at least
partly help make sure no one screws up and violates the aforementioned 
invariant.

    Of course, the checks aren't perfect, as the comment plaintively
reveals.  They won't catch some abuses, and they will allow others[1].

    But I would like to know: in what situation are they so onerous as 
to warrant this kind of mutinous commit? :-)

Sincerely,
Nat


[1] For example:

        bonobo_object_add_interface (a, b);
        b_i = bonobo_object_query_interface (a, "b");
        bonobo_object_unref (a);


        /* This should complain but won't */
        bonobo_object_add_interface (a, c);



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