MCPcopy Create free account
hub / github.com/assaultcube/AC / cleanup

Function cleanup

source/src/main.cpp:5–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include "cube.h"
4
5void cleanup(char *msg) // single program exit point;
6{
7 if(clientlogfile) clientlogfile->fflush();
8 if(!msg)
9 {
10 cleanupclient();
11 audiomgr.soundcleanup();
12 cleanupserver();
13 }
14 SDL_ShowCursor(SDL_TRUE);
15 SDL_SetRelativeMouseMode(SDL_FALSE);
16 if(msg)
17 {
18 #ifdef WIN32
19 MessageBox(NULL, msg, "AssaultCube fatal error", MB_OK|MB_SYSTEMMODAL|MB_ICONERROR);
20 #else
21 printf("%s", msg);
22 #endif
23 if(clientlogfile)
24 {
25 clientlogfile->printf("%s\n", msg);
26 dumpexecutionstack(clientlogfile);
27 }
28 }
29 SDL_Quit();
30}
31
32VAR(resetcfg, 0, 0, 1);
33

Callers 3

~packetbufMethod · 0.85
quitFunction · 0.85
fatalFunction · 0.85

Calls 6

cleanupclientFunction · 0.85
cleanupserverFunction · 0.85
dumpexecutionstackFunction · 0.85
soundcleanupMethod · 0.80
fflushMethod · 0.45
printfMethod · 0.45

Tested by

no test coverage detected