Index: pyatspi/registry.py
===================================================================
--- pyatspi/registry.py	(revision 975)
+++ pyatspi/registry.py	(working copy)
@@ -41,6 +41,7 @@
 import utils
 import constants
 import event
+import sys
 
 class _Observer(object):
   '''
@@ -269,8 +270,32 @@
     '''
     # wrap raw event so ref counts are correct before queueing
     ev = event.Event(ev)
+
+    # Record the current reference count of the event object and it's
+    # remote-object structure members.
+    prev_refs = {'event': sys.getrefcount(ev)}
+    for attrib in ('source', 'any_data', 'host_application'):
+      refrencable = getattr(ev, attrib, None)
+      if isinstance(refrencable, Accessibility.Accessible):
+        refrencable.dont_unref = True
+        prev_refs[attrib] = sys.getrefcount(refrencable)
+
+    # Handle the event.
     self.registry.handleEvent(ev)
 
+    # If there is an extra reference to the event object we need to ref()
+    # all the member objects.
+    ref_all =  sys.getrefcount(ev) - prev_refs['event'] > 0
+    
+    # If there is an extra reference to any remote object - ref() it.
+    for attrib in prev_refs:
+      refrencable = getattr(ev, attrib, None)
+      if refrencable is not None:
+        if ref_all or \
+           sys.getrefcount(refrencable) - prev_refs[attrib] > 0:
+          refrencable.ref()
+          refrencable.dont_unref = False
+
 class Registry(object):
   '''
   Wraps the Accessibility.Registry to provide more Pythonic registration for
Index: pyatspi/accessible.py
===================================================================
--- pyatspi/accessible.py	(revision 975)
+++ pyatspi/accessible.py	(working copy)
@@ -372,7 +372,7 @@
   @type SLOTS: tuple
   '''
   SLOTTED_CLASSES = {}
-  SLOTS = ('_icache', '_property_cache', '_user_data')
+  SLOTS = ('_icache', '_property_cache', '_user_data', 'dont_unref')
   
   def __new__(cls):
     '''
@@ -414,7 +414,8 @@
     we're caching properties. 
     '''
     try:
-      self.unref()
+      if not self.dont_unref:
+        self.unref()
     except Exception:
       pass
     
Index: pyatspi/event.py
===================================================================
--- pyatspi/event.py	(revision 975)
+++ pyatspi/event.py	(working copy)
@@ -137,13 +137,6 @@
     self.type = EventType(event.type)
     self.detail1 = event.detail1
     self.detail2 = event.detail2
-    # 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
 
     # process any_data in a at-spi version independent manner
@@ -163,16 +156,6 @@
       self.host_application = details.host_application
       self.source_name = details.source_name
       self.source_role = details.source_role
-    try:
-      # if we received an accessible, be sure to increment the ref count
-      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):
     '''
