about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-10 12:05:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-10 12:05:33 -0700
commitbe16deb0f94a283099652a82c9a5ea10abb86b67 (patch)
tree47dd9fcaedcdea9ef7a11425d8ccbc8b4d177c32
parenta66ad5339e35b2ada7f749103025c6800bd78796 (diff)
downloadmu-be16deb0f94a283099652a82c9a5ea10abb86b67.tar.gz
1330
-rw-r--r--000organization.cc5
-rw-r--r--026assert.cc1
-rw-r--r--070display.cc3
3 files changed, 8 insertions, 1 deletions
diff --git a/000organization.cc b/000organization.cc
index d3a5377b..9c45728a 100644
--- a/000organization.cc
+++ b/000organization.cc
@@ -101,6 +101,7 @@
 // End Globals
 
 int main(int argc, char* argv[]) {
+  atexit(teardown);
 
   // End One-time Setup
 
@@ -117,5 +118,9 @@ void teardown() {
   // End Teardown
 }
 
+:(before "End Includes")
+#include<stdlib.h>
+
+:(code)
 //: Without directives or with the :(code) directive, lines get added at the
 //: end.
diff --git a/026assert.cc b/026assert.cc
index 50456001..5b03e318 100644
--- a/026assert.cc
+++ b/026assert.cc
@@ -15,7 +15,6 @@ case ASSERT: {
   assert(ingredients.at(0).size() == 1);  // scalar
   if (!ingredients.at(0).at(0)) {
     assert(isa_literal(current_instruction().ingredients.at(1)));
-    tb_shutdown();
     raise << current_instruction().ingredients.at(1).name << '\n' << die();
   }
   break;
diff --git a/070display.cc b/070display.cc
index 938d3c8f..8a782f87 100644
--- a/070display.cc
+++ b/070display.cc
@@ -31,6 +31,9 @@ case RETURN_TO_CONSOLE: {
   break;
 }
 
+:(before "End Teardown")
+tb_shutdown();
+
 :(before "End Primitive Recipe Declarations")
 CLEAR_DISPLAY,
 :(before "End Primitive Recipe Numbers")