1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-30 17:36:45 +02:00

properly close windows on exit

This commit is contained in:
Jfreegman
2014-02-26 05:23:11 -05:00
parent 5ff7065744
commit a61f5f6a6d
7 changed files with 77 additions and 38 deletions

View File

@ -30,6 +30,7 @@
#include "friendlist.h"
#include "prompt.h"
#include "toxic_windows.h"
#include "groupchat.h"
extern char *DATA_FILE;
@ -409,3 +410,16 @@ int num_active_windows(void)
return count;
}
/* destroys all chat and groupchat windows (should only be called on shutdown) */
void kill_all_windows(void)
{
int i;
for (i = 0; i < MAX_WINDOWS_NUM; ++i) {
if (windows[i].is_chat)
kill_chat_window(&windows[i]);
else if (windows[i].is_groupchat)
kill_groupchat_window(&windows[i]);
}
}