1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Cleaning up memory allocated by ncurses pads

This commit is contained in:
James Booth 2012-07-31 23:01:15 +01:00
parent f7a542f488
commit 0a42be57a3
6 changed files with 20 additions and 1 deletions

1
.gitignore vendored
View File

@ -25,3 +25,4 @@ configure.scan
stamp-h1
*~
*dirstamp
valgrind.out

3
runvalgrind.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
rm -f valgrind.out
valgrind --log-file=valgrind.out --leak-check=full --track-origins=yes --show-reachable=yes ./profanity

View File

@ -96,6 +96,12 @@ prefs_load(void)
_load_colours();
}
void
prefs_close(void)
{
g_key_file_free(prefs);
}
static NCURSES_COLOR_T
_lookup_colour(const char * const colour)
{

View File

@ -26,6 +26,7 @@
#include <glib.h>
void prefs_load(void);
void prefs_close(void);
char * find_login(char *prefix);
void reset_login_search(void);

View File

@ -79,7 +79,7 @@ profanity_init(const int disable_tls)
jabber_init(disable_tls);
command_init();
contact_list_init();
tinyurl_init();
// tinyurl_init();
atexit(_profanity_shutdown);
}
@ -90,4 +90,5 @@ _profanity_shutdown(void)
gui_close();
log_close();
chat_log_close();
prefs_close();
}

View File

@ -125,6 +125,13 @@ gui_refresh(void)
void
gui_close(void)
{
int i;
for (i = 0; i < NUM_WINS; i++) {
if (_wins[i].win != NULL) {
delwin(_wins[i].win);
}
}
endwin();
}