MCPcopy Create free account
hub / github.com/diasurgical/devilution / dthread_cleanup

Function dthread_cleanup

Source/dthread.cpp:114–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void dthread_cleanup()
115{
116 const char *error_buf;
117 TMegaPkt *tmp;
118
119 if (sghWorkToDoEvent == NULL) {
120 return;
121 }
122
123 dthread_running = FALSE;
124 SetEvent(sghWorkToDoEvent);
125 if (sghThread != NULL && glpDThreadId != SDL_GetThreadID(NULL)) {
126 SDL_WaitThread(sghThread, NULL);
127 sghThread = NULL;
128 }
129 EndEvent(sghWorkToDoEvent);
130 sghWorkToDoEvent = NULL;
131
132 while (sgpInfoHead) {
133 tmp = sgpInfoHead->pNext;
134 MemFreeDbg(sgpInfoHead);
135 sgpInfoHead = tmp;
136 }
137}
138
139DEVILUTION_END_NAMESPACE

Callers 1

NetCloseFunction · 0.85

Calls 2

SetEventFunction · 0.85
EndEventFunction · 0.85

Tested by

no test coverage detected