[Nvda-dev] commit r3498 - trunk/source/NVDAObjects/UIA

NVDA Subversion svn at nvda-project.org
Mon Feb 1 00:21:05 UTC 2010


Author: bzr
Date: Mon Feb  1 00:21:05 2010
New Revision: 3498

Log:
UIA NVDAObject's __new__ method: If there is an error getting the UIA element's runtime ID, simply don't record the object in the live NVDAObject table, nore try and fetch a previously recorded NVDAObject.  Previously  if there was an error fetching the runtime Id,  the exception would cause many other strange errors in NVDA such as infinite focus ancestries, missing parents, and other indirect exceptions. Although very rare.

Modified:
   trunk/source/NVDAObjects/UIA/__init__.py

Modified: trunk/source/NVDAObjects/UIA/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/UIA/__init__.py	(original)
+++ trunk/source/NVDAObjects/UIA/__init__.py	Mon Feb  1 00:21:05 2010
@@ -176,13 +176,17 @@
 			runtimeId=UIAElement.getRuntimeId()
 		except COMError:
 			log.debugWarning("Could not get UIA element runtime Id",exc_info=True)
-			return None
-		obj=cls.liveNVDAObjectTable.get(runtimeId,None)
+			runtimeId=None
+		if not runtimeId:
+			obj=cls.liveNVDAObjectTable.get(runtimeId,None)
+		else:
+			obj=None
 		if not obj:
 			obj=super(UIA,cls).__new__(cls)
 			if not obj:
 				return None
-			cls.liveNVDAObjectTable[runtimeId]=obj
+			if runtimeId:
+				cls.liveNVDAObjectTable[runtimeId]=obj
 		else:
 			obj.UIAElement=UIAElement
 		return obj



More information about the Nvda-dev mailing list