aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-04-14 13:09:46 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-04-14 13:09:46 -0700
commit125f7513320e6516c594a8e6c5f7807f09267695 (patch)
tree1cdca4c1fc252c0e216fd6b658e4cf923025faa9
parent0d3524b29e5e8718f80c51de4975f4c1e838d015 (diff)
clean up emscripten temp dir
-rw-r--r--tools/shared.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index ec3e8d09..3f0d89ec 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -1,4 +1,4 @@
-import shutil, time, os, sys, json, tempfile, copy, shlex
+import shutil, time, os, sys, json, tempfile, copy, shlex, atexit
from subprocess import Popen, PIPE, STDOUT
from tempfile import mkstemp
@@ -145,6 +145,9 @@ if os.environ.get('EMCC_DEBUG'):
if not EMSCRIPTEN_TEMP_DIR:
EMSCRIPTEN_TEMP_DIR = tempfile.mkdtemp(prefix='emscripten_temp_')
+ def clean_temp():
+ try_delete(EMSCRIPTEN_TEMP_DIR)
+ atexit.register(clean_temp)
# EM_CONFIG stuff