From cc26fd2becde2e92b9e82e3aa7105b2d66276ab0 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Fri, 5 Mar 2010 23:06:53 +0300 Subject: [PATCH] Free FS info before closing panel. Signed-off-by: Andrew Borodin --- src/mountlist.c | 11 ++++++++++- src/mountlist.h | 1 + src/screen.c | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mountlist.c b/src/mountlist.c index 86dd361a0..a773c6dd6 100644 --- a/src/mountlist.c +++ b/src/mountlist.c @@ -688,7 +688,7 @@ read_filesystem_list(int need_fs_type, int all_fs) #endif /* HAVE_INFOMOUNT_QNX */ void -init_my_statfs (void) +free_my_statfs (void) { #ifdef HAVE_INFOMOUNT_LIST while (mount_list) { @@ -696,7 +696,16 @@ init_my_statfs (void) free_mount_entry (mount_list); mount_list = next; } + mount_list = NULL; +#endif /* HAVE_INFOMOUNT_LIST */ +} + +void +init_my_statfs (void) +{ +#ifdef HAVE_INFOMOUNT_LIST + free_my_statfs (); mount_list = read_filesystem_list (1, 1); #endif /* HAVE_INFOMOUNT_LIST */ } diff --git a/src/mountlist.h b/src/mountlist.h index c57c4a7c0..390a356cd 100644 --- a/src/mountlist.h +++ b/src/mountlist.h @@ -36,5 +36,6 @@ struct my_statfs { void init_my_statfs (void); void my_statfs (struct my_statfs *myfs_stats, const char *path); +void free_my_statfs (void); #endif diff --git a/src/screen.c b/src/screen.c index 2b1e538a8..3463bd9f5 100644 --- a/src/screen.c +++ b/src/screen.c @@ -3100,6 +3100,7 @@ panel_callback (Widget * w, widget_msg_t msg, int parm) case WIDGET_DESTROY: panel_destroy (panel); + free_my_statfs (); return MSG_HANDLED; default: