diff options
author | Jeffrey Stedfast <jeff@xamarin.com> | 2012-06-01 00:31:53 +0400 |
---|---|---|
committer | Jeffrey Stedfast <jeff@xamarin.com> | 2012-06-01 00:31:53 +0400 |
commit | f7da82d87224009486794739c38fd1a3947d749b (patch) | |
tree | 582df6323c8eba425d20876edb8a39c766e1ed3b | |
parent | a6d11f755322a1efcb2673ca09c8034c00ded5fa (diff) |
[MacDev] Prevent infinite loop when getting all base class defs
-rwxr-xr-x | main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs index 43d6767bea..28717c617d 100755 --- a/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs +++ b/main/src/addins/MonoDevelop.MacDev/ObjCIntegration/NSObjectProjectInfo.cs @@ -177,15 +177,19 @@ namespace MonoDevelop.MacDev.ObjCIntegration static IEnumerable<ITypeDefinition> GetAllBaseClassDefinitions (IType type) { while (type != null) { + IType baseType = null; + foreach (var t in type.DirectBaseTypes) { if (t.Kind != TypeKind.Class) continue; var def = t.GetDefinition (); if (def != null) yield return def; - type = t; + baseType = t; break; } + + type = baseType; } } |