aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c12
1 files changed, 7 insertions, 5 deletions
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