[Sugar-devel] [sugar PATCH] sl#3326: Do not attach any signals to the dangling-connection-object after it has called the "__connection_ready_cb" callback.

Daniel Drake dsd at laptop.org
Wed Jul 25 16:59:27 EDT 2012


On Wed, Jul 25, 2012 at 2:52 PM, Ajay Garg <ajay at activitycentral.com> wrote:
> Thanks to Jerry Vonau, for inspiring and guiding me to solve this :-)

Thanks for working on this!

>  src/jarabe/model/neighborhood.py |   19 +++++++++++++++++++
>  1 files changed, 19 insertions(+), 0 deletions(-)
>
> diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
> index 39f648e..5692ca9 100644
> --- a/src/jarabe/model/neighborhood.py
> +++ b/src/jarabe/model/neighborhood.py
> @@ -260,6 +260,25 @@ class _Account(gobject.GObject):
>                                        ready_handler=self.__connection_ready_cb)
>
>      def __connection_ready_cb(self, connection):
> +        # http://bugs.sugarlabs.org/ticket/3326
> +        #
> +        # Daniel Drake has given a comprehensive description of the
> +        # issue. So the fix is that, when the
> +        # dangling-connection-object calls the "__connection_ready_cb",
> +        # check to see if it is the same as the referenced
> +        # "self._connection" object. If not, simply return; this would
> +        # have the following consequences ::
> +        #
> +        #  (i)
> +        #  not connect any more signals to the
> +        #  dangling-connection-object.
> +        #
> +        #  (ii)
> +        #  the dangling-connection-object would finally be
> +        #  garbage-collected.
> +        if connection != self._connection:
> +            return
> +

This probably works, but its a workaround rather than a fix. (Also,
I'm doubtful that it would be garbage collected at this point. Have
you verified this?)

The core of the problem is that two Connection objects are created to
track a single telepathy connection. A patch that addresses this would
correctly solve the problem.

Have you considered the approach I suggested on the ticket?

Thanks
Daniel


More information about the Sugar-devel mailing list