From: Jean-Philippe Orsini Date: Tue, 17 Apr 2012 08:25:58 +0000 (+0000) Subject: fixed memory leak (sensor name when specified by the X-Git-Tag: v0.8.0.5~425 X-Git-Url: https://git.wpitchoune.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=82c3a2ff60323db457b8810011bff7e66fecd2fc;p=psensor.git fixed memory leak (sensor name when specified by the configuration). --- diff --git a/src/main.c b/src/main.c index 95163e0..89cf2b9 100644 --- a/src/main.c +++ b/src/main.c @@ -308,8 +308,10 @@ static void associate_preferences(struct psensor **sensors) n = config_get_sensor_name(s->id); - if (n) + if (n) { + free(s->name); s->name = n; + } sensor_cur++; } @@ -528,6 +530,8 @@ int main(int argc, char **argv) /* main loop */ gtk_main(); + log_debug("Quitting..."); + g_mutex_lock(ui.sensors_mutex); psensor_cleanup(); @@ -555,6 +559,8 @@ int main(int argc, char **argv) config_cleanup(); + log_debug("Cleanup done, closing log"); + log_close(); return 0;