Adding some startup bullet-proofing

This commit is contained in:
Greg Wiatroski 2008-09-24 00:20:37 +00:00
parent 2daea47ccf
commit 5af08f799f
1 changed files with 5 additions and 3 deletions

View File

@ -1111,9 +1111,11 @@ class TaskManager:
self._gcTask = self.add(self._garbageCollect, TaskManager.GarbageCollectTaskName, 200)
if not self._profileTasks:
from direct.fsm.StatePush import StateVar
self._profileTasks = StateVar(False)
self.setProfileTasks(getBase().config.GetBool('profile-task-spikes', 0))
if 'base' in __builtins__.__dict__ or \
'simbase' in __builtins__.__dict__:
from direct.fsm.StatePush import StateVar
self._profileTasks = StateVar(False)
self.setProfileTasks(getBase().config.GetBool('profile-task-spikes', 0))
# Set the clock to have last frame's time in case we were
# Paused at the prompt for a long time