Fix a bunch of obvious memory leaks at termination
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
static int inp_size;
|
||||
static gboolean perform_resize = FALSE;
|
||||
static GTimer* ui_idle_time;
|
||||
static WINDOW* main_scr;
|
||||
|
||||
#ifdef HAVE_LIBXSS
|
||||
static Display* display;
|
||||
@@ -92,7 +93,7 @@ void
|
||||
ui_init(void)
|
||||
{
|
||||
log_info("Initialising UI");
|
||||
initscr();
|
||||
main_scr = initscr();
|
||||
nonl();
|
||||
cbreak();
|
||||
noecho();
|
||||
@@ -182,12 +183,16 @@ ui_reset_idle_time(void)
|
||||
void
|
||||
ui_close(void)
|
||||
{
|
||||
g_timer_destroy(ui_idle_time);
|
||||
endwin();
|
||||
notifier_uninit();
|
||||
cons_clear_alerts();
|
||||
wins_destroy();
|
||||
inp_close();
|
||||
status_bar_close();
|
||||
endwin();
|
||||
free_title_bar();
|
||||
delwin(main_scr);
|
||||
delscreen(set_term(NULL));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -273,6 +273,7 @@ void
|
||||
inp_close(void)
|
||||
{
|
||||
rl_callback_handler_remove();
|
||||
delwin(inp_win);
|
||||
fclose(discard);
|
||||
}
|
||||
|
||||
|
||||
@@ -119,9 +119,7 @@ status_bar_init(void)
|
||||
void
|
||||
status_bar_close(void)
|
||||
{
|
||||
if (tz) {
|
||||
g_time_zone_unref(tz);
|
||||
}
|
||||
delwin(statusbar_win);
|
||||
if (statusbar) {
|
||||
if (statusbar->time) {
|
||||
g_free(statusbar->time);
|
||||
@@ -137,6 +135,9 @@ status_bar_close(void)
|
||||
}
|
||||
free(statusbar);
|
||||
}
|
||||
if (tz) {
|
||||
g_time_zone_unref(tz);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -85,6 +85,12 @@ create_title_bar(void)
|
||||
inp_put_back();
|
||||
}
|
||||
|
||||
void
|
||||
free_title_bar(void)
|
||||
{
|
||||
delwin(win);
|
||||
}
|
||||
|
||||
void
|
||||
title_bar_update_virtual(void)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
#define UI_TITLEBAR_H
|
||||
|
||||
void create_title_bar(void);
|
||||
void free_title_bar(void);
|
||||
void title_bar_update_virtual(void);
|
||||
void title_bar_resize(void);
|
||||
void title_bar_console(void);
|
||||
|
||||
@@ -187,6 +187,7 @@ tray_shutdown(void)
|
||||
}
|
||||
g_string_free(icon_filename, TRUE);
|
||||
g_string_free(icon_msg_filename, TRUE);
|
||||
gtk_main_quit();
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user