* event.py (Event.__init__): Catch AttributeError when ref()ing
authoreitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 25 Oct 2007 16:58:12 +0000 (16:58 +0000)
committereitani <eitani@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Thu, 25 Oct 2007 16:58:12 +0000 (16:58 +0000)
event.source (bug #490205).
* accessible.py (_makeExceptionHandler._inner): If return value is
a CORBA object, ref() it (bug #490202).

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@959 e2bd861d-eb25-0410-b326-f6ed22b6b98c

pyatspi/ChangeLog
pyatspi/accessible.py
pyatspi/event.py

index 730ab56..b558cd0 100644 (file)
@@ -1,3 +1,10 @@
+2007-10-25  Eitan Isaacson  <eitan@ascender.com>
+
+       * event.py (Event.__init__): Catch AttributeError when ref()ing 
+       event.source (bug #490205).
+       * accessible.py (_makeExceptionHandler._inner): If return value is
+       a CORBA object, ref() it (bug #490202).
+
 2007-10-22  Eitan Isaacson  <eitan@ascender.com>
 
        * accessible.py (_RelationMixin.getTarget): Add a ref() to the
index 5aadb9e..433d05b 100644 (file)
@@ -183,7 +183,9 @@ def _makeExceptionHandler(func):
   def _inner(self, *args, **kwargs):
     try:
       # try calling the original func
-      return func(self, *args, **kwargs)
+      rv = func(self, *args, **kwargs)
+      if isinstance(rv, ORBit.CORBA.Object): rv.ref()
+      return rv
     except ORBit.CORBA.NO_IMPLEMENT, e:
       # raise Python exception
       raise NotImplementedError(e)
index da97120..bc230f2 100644 (file)
@@ -140,8 +140,11 @@ class Event(object):
     # store the event source and increase the reference count since event 
     # sources are borrowed references; the AccessibleMixin automatically
     # decrements it later
+    try:
+      event.source.ref()
+    except AttributeError:
+      pass
     self.source = event.source
-    self.source.ref()
 
     # process any_data in a at-spi version independent manner
     details = event.any_data.value()