updated CppMemoryUsage

This commit is contained in:
Darren Ranalli 2009-02-12 07:30:09 +00:00
parent e10ca3fdb3
commit d6ca95f510
1 changed files with 7 additions and 2 deletions

View File

@ -62,8 +62,13 @@ class SceneGraphLeakDetector(LeakDetector):
class CppMemoryUsage(LeakDetector):
def __len__(self):
if config.GetBool('track-memory-usage', 0):
return int(MemoryUsage.getCppSize())
haveMemoryUsage = True
try:
MemoryUsage
except:
haveMemoryUsage = False
if haveMemoryUsage:
return int(MemoryUsage.getCurrentCppSize())
else:
return 0