cleanup keyword databases on proram termination

This commit is contained in:
rlar 2012-08-23 21:19:15 +02:00
parent 80bc975e33
commit 3d7ab6a297
3 changed files with 13 additions and 0 deletions

View File

@ -75,6 +75,7 @@ com_quit(wordlist *wl)
/* then go away */
cp_destroy_keywords();
destroy_ivars();
byemesg();

View File

@ -496,6 +496,16 @@ cp_addkword(int kw_class, char *word)
return;
}
void
cp_destroy_keywords(void)
{
int i;
for (i=0; i<NCLASSES; i++)
throwaway(keywords[i]);
throwaway(commands);
}
/* Remove a keyword from the database. */
void

View File

@ -44,6 +44,8 @@ extern void cp_ccon(bool on);
extern void cp_ccrestart(bool kwords);
extern void cp_remcomm(char *word);
extern void cp_remkword(int kw_class, char *word);
extern void cp_destroy_keywords(void);
extern wordlist *cp_cctowl(struct ccom *stuff);
/* cshpar.c */