thermferm/panel.c

changeset 238
a0f1deb65889
parent 229
5f93b61adb34
child 241
4ba138737bf4
--- a/thermferm/panel.c	Wed Aug 13 22:02:14 2014 +0200
+++ b/thermferm/panel.c	Thu Aug 14 21:50:38 2014 +0200
@@ -49,6 +49,7 @@
 extern int		my_shutdown;
 extern int		debug;
 extern int		setupmenu;
+extern units_list	*current_unit;
 
 int			Key_Enter = FALSE;
 int			Key_Enter_Long = FALSE;
@@ -181,8 +182,12 @@
 	    	if (setupmenu != MENU_NONE) {
 		    if (menutimer < MENU_TIMEOUT)
 			menutimer++;
-		    else
+		    else {
 			setupmenu = MENU_NONE;
+			if (current_unit)
+			    free(current_unit);
+			current_unit = NULL;
+		    }
 		}
 	    }
 	}

mercurial