* event.py (Event.__init__): Ref() the host_application attribute
authoreitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 1 Nov 2007 21:09:45 +0000 (21:09 +0000)
committereitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 1 Nov 2007 21:09:45 +0000 (21:09 +0000)
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
pyatspi/accessible.py
pyatspi/event.py

index a865000..7b94346 100644 (file)
@@ -1,3 +1,11 @@
+2007-11-01  Eitan Isaacson  <eitan@ascender.com>
+
+       * 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  <eitan@ascender.com>
 
        * accessible.py (_AccessibleMixin.__del__): Catch TypeError 
index f022ca2..faf5b25 100644 (file)
@@ -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)
index bc230f2..4c581bd 100644 (file)
@@ -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):
     '''