debug msgs
[psensor.git] / src / main.c
index 6ad3547..92c7e53 100644 (file)
@@ -252,7 +252,7 @@ static void associate_colors(struct psensor **sensors)
        unsigned int colors[COLORS_COUNT][3] = {
                {0x0000, 0x0000, 0x0000},       /* black */
                {0xffff, 0x0000, 0x0000},       /* red */
-               {0x0000, 0.0000, 0xffff},       /* blue */
+               {0x0000, 0x0000, 0xffff},       /* blue */
                {0x0000, 0xffff, 0x0000},       /* green */
 
                {0x7fff, 0x7fff, 0x7fff},       /* grey */
@@ -402,6 +402,8 @@ static void cleanup(struct ui_psensor *ui)
 {
        g_mutex_lock(ui->sensors_mutex);
 
+       log_debug("Cleanup...");
+
        psensor_cleanup();
 
 #ifdef HAVE_NVIDIA
@@ -465,6 +467,9 @@ static struct psensor **create_sensors_list(const char *url,
 #endif
        }
 
+       associate_preferences(sensors);
+       associate_colors(sensors);
+
        return sensors;
 }
 
@@ -551,15 +556,11 @@ int main(int argc, char **argv)
 
        ui.sensors_mutex = g_mutex_new();
 
-       config_init();
-
        ui.config = config_load();
 
        psensor_init();
 
        ui.sensors = create_sensors_list(url, use_libatasmart);
-       associate_preferences(ui.sensors);
-       associate_colors(ui.sensors);
        associate_cb_alarm_raised(ui.sensors, &ui);
 
 #if !defined(HAVE_APPINDICATOR) && !defined(HAVE_APPINDICATOR_029)
@@ -606,8 +607,8 @@ int main(int argc, char **argv)
        /* main loop */
        gtk_main();
 
-       log_debug("Quitting...");
        cleanup(&ui);
+       log_debug("Quitting...");
 
        return 0;
 }