Skip to content

Commit 03b6d89

Browse files
committed
Replicate in Generals
1 parent 447d1c2 commit 03b6d89

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

Generals/Code/GameEngine/Source/Common/System/StackDump.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
// Prototypes
3838
//*****************************************************************************
3939
BOOL InitSymbolInfo(void);
40-
void UninitSymbolInfo(void);
4140
void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*));
4241
void GetFunctionDetails(void *pointer, char*name, char*filename, unsigned int* linenumber, unsigned int* address);
4342
void WriteStackLine(void*address, void (*callback)(const char*));
@@ -109,10 +108,14 @@ BOOL InitSymbolInfo()
109108
if (DbgHelpLoader::isLoaded())
110109
return TRUE;
111110

112-
if (!DbgHelpLoader::load())
111+
if (DbgHelpLoader::isFailed())
113112
return FALSE;
114113

115-
atexit(UninitSymbolInfo);
114+
if (!DbgHelpLoader::load())
115+
{
116+
atexit(DbgHelpLoader::unload);
117+
return FALSE;
118+
}
116119

117120
char pathname[_MAX_PATH+1];
118121
char drive[10];
@@ -140,24 +143,16 @@ BOOL InitSymbolInfo()
140143
if(DbgHelpLoader::symLoadModule(process, NULL, pathname, NULL, 0, 0))
141144
{
142145
//Load any other relevant modules (ie dlls) here
146+
atexit(DbgHelpLoader::unload);
143147
return TRUE;
144148
}
145149
}
146150

147151
DbgHelpLoader::unload();
148-
return(FALSE);
152+
return FALSE;
149153
}
150154

151155

152-
//*****************************************************************************
153-
//*****************************************************************************
154-
void UninitSymbolInfo(void)
155-
{
156-
DbgHelpLoader::unload();
157-
}
158-
159-
160-
161156
//*****************************************************************************
162157
//*****************************************************************************
163158
void MakeStackTrace(DWORD myeip,DWORD myesp,DWORD myebp, int skipFrames, void (*callback)(const char*))

0 commit comments

Comments
 (0)