gui: Use trap to make sure temporary files are removed.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 13 Sep 2014 14:16:34 +0000 (16:16 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 27 Sep 2014 23:02:00 +0000 (23:02 +0000)
Without this, killing the application might leave a temporary file.

gui

diff --git a/gui b/gui
index 6003a90..f608196 100644 (file)
--- 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