瀏覽代碼

fix for crash due to previous checkin

Darren Ranalli 17 年之前
父節點
當前提交
d4e22c0795
共有 1 個文件被更改,包括 6 次插入3 次删除
  1. 6 3
      direct/src/showbase/ContainerLeakDetector.py

+ 6 - 3
direct/src/showbase/ContainerLeakDetector.py

@@ -547,7 +547,8 @@ class FindContainers(Job):
                     if hasLength or notDeadEnd:
                         # prevent cycles in the references (i.e. base.loader.base)
                         for goesThrough in parentObjRef.goesThroughGen(child):
-                            yield None
+                            # don't yield, container might lose this element
+                            pass
                         if not goesThrough:
                             objRef = ObjectRef(Indirection(evalStr='.__dict__'),
                                                id(child), parentObjRef)
@@ -585,7 +586,8 @@ class FindContainers(Job):
                         if hasLength or notDeadEnd:
                             # prevent cycles in the references (i.e. base.loader.base)
                             for goesThrough in parentObjRef.goesThroughGen(curObj[key]):
-                                yield None
+                                # don't yield, container might lose this element
+                                pass
                             if not goesThrough:
                                 if curObj is __builtin__.__dict__:
                                     objRef = ObjectRef(Indirection(evalStr='%s' % key),
@@ -636,7 +638,8 @@ class FindContainers(Job):
                                 if hasLength or notDeadEnd:
                                     # prevent cycles in the references (i.e. base.loader.base)
                                     for goesThrough in parentObjRef.goesThrough(curObj[index]):
-                                        yield None
+                                        # don't yield, container might lose this element
+                                        pass
                                     if not goesThrough:
                                         objRef = ObjectRef(Indirection(evalStr='[%s]' % index),
                                                            id(curObj[index]), parentObjRef)