--- a/thermferm/panel.c Sat Aug 16 15:38:45 2014 +0200 +++ b/thermferm/panel.c Sat Aug 16 17:11:09 2014 +0200 @@ -49,7 +49,6 @@ extern int my_shutdown; extern int debug; extern int setupmenu; -extern units_list *current_unit; int Key_Enter = FALSE; int Key_Enter_Long = FALSE; @@ -184,16 +183,15 @@ Backlight--; } + piLock(LOCK_MENU); if (setupmenu != MENU_NONE) { if (menutimer < MENU_TIMEOUT) menutimer++; else { setupmenu = MENU_NONE; - if (current_unit) - free(current_unit); - current_unit = NULL; } } + piUnlock(LOCK_MENU); } }