summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 18a8037)
raw | patch | inline | side by side (parent: 18a8037)
author | Max Kellermann <max@duempel.org> | |
Fri, 14 Aug 2009 21:44:06 +0000 (23:44 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 14 Aug 2009 21:44:06 +0000 (23:44 +0200) |
Clean up before exiting, make valgrind happy.
src/main.c | patch | blob | history | |
src/options.c | patch | blob | history | |
src/options.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index c80b7ea1fe3f0a0fc26eb082589645c0a5ae3587..fc733664c93a39a91ac282e982b4af35180b62b9 100644 (file)
--- a/src/main.c
+++ b/src/main.c
mpdclient_disconnect(mpd);
mpdclient_free(mpd);
}
-
- g_free(options.host);
- g_free(options.password);
- g_free(options.list_format);
- g_free(options.status_format);
-#ifndef NCMPC_MINI
- g_free(options.scroll_sep);
-#endif
}
static void
#endif
ncu_deinit();
+ options_deinit();
return 0;
}
diff --git a/src/options.c b/src/options.c
index c4540d38f25f17b42859b94c1e1bd2279ed97738..99dddedd236f163348f9452220a2bdda181ae704 100644 (file)
--- a/src/options.c
+++ b/src/options.c
options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
#endif
}
+
+void
+options_deinit(void)
+{
+ g_free(options.host);
+ g_free(options.username);
+ g_free(options.password);
+ g_free(options.config_file);
+ g_free(options.key_file);
+ g_free(options.list_format);
+ g_free(options.status_format);
+ g_strfreev(options.screen_list);
+#ifndef NCMPC_MINI
+ g_free(options.xterm_title_format);
+ g_free(options.scroll_sep);
+#endif
+ g_free(options.timedisplay_type);
+}
diff --git a/src/options.h b/src/options.h
index 5927d4c443b8d9e84727709ccc20f33e1275bf62..1cc2eb7f4f683abf9d9993fd0e6f40bfd4e385cf 100644 (file)
--- a/src/options.h
+++ b/src/options.h
extern options_t options;
void options_init(void);
+void options_deinit(void);
+
void options_parse(int argc, const char **argv);
#endif