fix startup crash

This commit is contained in:
Darren Ranalli 2007-05-14 23:29:20 +00:00
parent f191acace1
commit 7e54ae47b7
2 changed files with 12 additions and 4 deletions

View File

@ -651,7 +651,10 @@ def toggleGuiGridSnap():
def setGuiGridSpacing(spacing):
DirectGuiWidget.gridSpacing = spacing
if __dev__:
# this should trigger off of __dev__, but it's not available at this point.
# __debug__ works because the production client is not __debug__ and the
# production AI doesn't create any GUI.
if config.GetBool('record-gui-creation-stack', __debug__):
# this will help track down the code that created DirectGui objects
# call obj.getCreationStackTrace() to figure out what code created it
DirectGuiBase = recordCreationStack(DirectGuiBase)

View File

@ -76,9 +76,14 @@ class Task:
debugTaskTraceback = 0 # base.config.GetBool('debug-task-traceback', 0)
count = 0
def __init__(self, callback, priority = 0):
if __dev__:
if self.debugTaskTraceback:
self.debugInitTraceback = StackTrace("Task "+str(callback), 1, 10)
try:
config
except:
pass
else:
if config.GetBool('record-task-creation-stack', __dev__):
if self.debugTaskTraceback:
self.debugInitTraceback = StackTrace("Task "+str(callback), 1, 10)
# Unique ID for each task
self.id = Task.count
Task.count += 1