stats: allow stats to be reset even if no objects have been instantiated
This commit is contained in:
parent
c24f1df343
commit
88033eb608
1 changed files with 3 additions and 1 deletions
|
@ -59,6 +59,8 @@ def dump():
|
|||
def reset():
|
||||
# call reset stats on all SimObjects
|
||||
root = Root.getInstance()
|
||||
for obj in root.descendants(): obj.resetStats()
|
||||
if root:
|
||||
for obj in root.descendants(): obj.resetStats()
|
||||
|
||||
# call any other registered stats reset callbacks
|
||||
internal.stats.reset()
|
||||
|
|
Loading…
Reference in a new issue