]> git.tue.mpg.de Git - gsu.git/commitdiff
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 6003a90ab18a11c51bf4ae4c0a98fa4e74c2bb38..f60819668035d53356b6cf8cddf735512fe53ed5 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