gui: Use trap to make sure temporary files are removed.
[gsu.git] / 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