prism2.device: Compiler delint
[AROS.git] / workbench / utilities / Installer / cleanup.c
blob3e07c78e804fdf00e57c334592773c3f6f0483d7
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /* cleanup.c -- here are all functions used before exiting program */
8 #include "Installer.h"
9 #include "execute.h"
10 #include "locale.h"
11 #include "gui.h"
12 #include "procedure.h"
13 #include "variables.h"
14 #include "cleanup.h"
16 /* External variables */
17 extern ScriptArg script;
18 extern InstallerPrefs preferences;
19 extern int error;
22 void free_script(ScriptArg *first)
24 if (first != NULL)
26 free_script(first->cmd);
27 free_script(first->next);
28 FreeVec(first->arg);
29 FreeVec(first);
33 void cleanup()
35 if (preferences.transcriptstream != BNULL)
37 Close(preferences.transcriptstream);
40 free_script(script.cmd);
41 free_varlist();
42 deinit_gui();
43 Locale_Deinitialize();
46 void end_malloc()
48 end_alloc();
51 void end_alloc()
53 #ifdef DEBUG
54 fprintf(stderr, "Couldn't allocate memory!\n");
55 #endif /* DEBUG */
56 cleanup();
57 exit(-1);
60 void outofmem(void * ptr)
62 if (ptr == NULL)
64 error = OUTOFMEMORY;
65 traperr("Out of memory!\n", NULL);