From: Andre Noll Date: Sat, 13 Sep 2014 14:16:34 +0000 (+0200) Subject: gui: Use trap to make sure temporary files are removed. X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=dd72676c4bd2cc300a655d5c0bf202fc0a559c6f;p=gsu.git gui: Use trap to make sure temporary files are removed. Without this, killing the application might leave a temporary file. --- diff --git a/gui b/gui index 6003a90..f608196 100644 --- a/gui +++ b/gui @@ -87,6 +87,7 @@ gsu_msgbox() result='temp file for textbox' return fi + trap "rm -f $tmp" EXIT echo "$1" > "$tmp" gsu_textbox "$tmp" rm -f "$tmp" # ignore errors