From 0ce898eafc8210911be4165a7dd28d3b662fd311 Mon Sep 17 00:00:00 2001 From: eitani Date: Thu, 1 Nov 2007 21:09:45 +0000 Subject: [PATCH] * event.py (Event.__init__): Ref() the host_application attribute if it is available (bug #492469). * accessible.py (_makeExceptionHandler._inner): Revert patch from bug #490202. This was the wrong fix. Objects that are returned from methods are already reffed. git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@965 e2bd861d-eb25-0410-b326-f6ed22b6b98c --- pyatspi/ChangeLog | 8 ++++++++ pyatspi/accessible.py | 4 +--- pyatspi/event.py | 5 +++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pyatspi/ChangeLog b/pyatspi/ChangeLog index a865000..7b94346 100644 --- a/pyatspi/ChangeLog +++ b/pyatspi/ChangeLog @@ -1,3 +1,11 @@ +2007-11-01 Eitan Isaacson + + * event.py (Event.__init__): Ref() the host_application attribute + if it is available (bug #492469). + * accessible.py (_makeExceptionHandler._inner): Revert patch from + bug #490202. This was the wrong fix. Objects that are returned + from methods are already reffed. + 2007-10-30 Eitan Isaacson * accessible.py (_AccessibleMixin.__del__): Catch TypeError diff --git a/pyatspi/accessible.py b/pyatspi/accessible.py index f022ca2..faf5b25 100644 --- a/pyatspi/accessible.py +++ b/pyatspi/accessible.py @@ -183,9 +183,7 @@ def _makeExceptionHandler(func): def _inner(self, *args, **kwargs): try: # try calling the original func - rv = func(self, *args, **kwargs) - if isinstance(rv, ORBit.CORBA.Object): rv.ref() - return rv + return func(self, *args, **kwargs) except ORBit.CORBA.NO_IMPLEMENT, e: # raise Python exception raise NotImplementedError(e) diff --git a/pyatspi/event.py b/pyatspi/event.py index bc230f2..4c581bd 100644 --- a/pyatspi/event.py +++ b/pyatspi/event.py @@ -168,6 +168,11 @@ class Event(object): self.any_data.ref() except AttributeError: pass + try: + # if we received a host application, be sure to increment the ref count + self.host_application.ref() + except AttributeError: + pass def __str__(self): ''' -- 2.7.4