aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ldo.c3
-rw-r--r--lstate.c12
2 files changed, 9 insertions, 6 deletions
diff --git a/ldo.c b/ldo.c
index e6125e36..788cfedb 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 1.47 1999/09/06 15:24:46 roberto Exp roberto $ 2** $Id: ldo.c,v 1.48 1999/10/04 17:51:04 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -236,6 +236,7 @@ void lua_error (const char *s) {
236 if (L->errorJmp) 236 if (L->errorJmp)
237 longjmp(L->errorJmp->b, 1); 237 longjmp(L->errorJmp->b, 1);
238 else { 238 else {
239 LUA_INTERNALERROR("exit!!");
239 message("exit(1). Unable to recover.\n"); 240 message("exit(1). Unable to recover.\n");
240 exit(1); 241 exit(1);
241 } 242 }
diff --git a/lstate.c b/lstate.c
index c8f3d65b..281206bc 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 1.13 1999/08/16 20:52:00 roberto Exp roberto $ 2** $Id: lstate.c,v 1.14 1999/10/04 17:51:04 roberto Exp $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -53,6 +53,10 @@ void lua_open (void) {
53 53
54void lua_close (void) { 54void lua_close (void) {
55 luaC_collect(1); /* collect all elements */ 55 luaC_collect(1); /* collect all elements */
56 LUA_ASSERT(L->rootproto == NULL, "list should be empty");
57 LUA_ASSERT(L->rootcl == NULL, "list should be empty");
58 LUA_ASSERT(L->rootglobal == NULL, "list should be empty");
59 LUA_ASSERT(L->roottable == NULL, "list should be empty");
56 luaS_freeall(); 60 luaS_freeall();
57 luaM_free(L->stack.stack); 61 luaM_free(L->stack.stack);
58 luaM_free(L->IMtable); 62 luaM_free(L->IMtable);
@@ -61,11 +65,9 @@ void lua_close (void) {
61 luaM_free(L->Cblocks); 65 luaM_free(L->Cblocks);
62 LUA_ASSERT(L->nblocks == 0, "wrong count for nblocks"); 66 LUA_ASSERT(L->nblocks == 0, "wrong count for nblocks");
63 luaM_free(L); 67 luaM_free(L);
68 LUA_ASSERT(numblocks == 0, "memory leak!");
69 LUA_ASSERT(totalmem == 0,"memory leak!");
64 L = NULL; 70 L = NULL;
65#ifdef DEBUG
66 printf("total de blocos: %ld\n", numblocks);
67 printf("total de memoria: %ld\n", totalmem);
68#endif
69} 71}
70 72
71 73