diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 1.26 2000/05/08 19:32:53 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 1.27 2000/06/12 13:52:05 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -88,22 +88,22 @@ lua_State *lua_newstate (const char *s, ...) { | |||
88 | 88 | ||
89 | void lua_close (lua_State *L) { | 89 | void lua_close (lua_State *L) { |
90 | luaC_collect(L, 1); /* collect all elements */ | 90 | luaC_collect(L, 1); /* collect all elements */ |
91 | LUA_ASSERT(L, L->rootproto == NULL, "list should be empty"); | 91 | LUA_ASSERT(L->rootproto == NULL, "list should be empty"); |
92 | LUA_ASSERT(L, L->rootcl == NULL, "list should be empty"); | 92 | LUA_ASSERT(L->rootcl == NULL, "list should be empty"); |
93 | LUA_ASSERT(L, L->roottable == NULL, "list should be empty"); | 93 | LUA_ASSERT(L->roottable == NULL, "list should be empty"); |
94 | luaS_freeall(L); | 94 | luaS_freeall(L); |
95 | luaM_free(L, L->stack); | 95 | luaM_free(L, L->stack); |
96 | luaM_free(L, L->IMtable); | 96 | luaM_free(L, L->IMtable); |
97 | luaM_free(L, L->refArray); | 97 | luaM_free(L, L->refArray); |
98 | luaM_free(L, L->Mbuffer); | 98 | luaM_free(L, L->Mbuffer); |
99 | luaM_free(L, L->Cblocks); | 99 | luaM_free(L, L->Cblocks); |
100 | LUA_ASSERT(L, L->numCblocks == 0, "Cblocks still open"); | 100 | LUA_ASSERT(L->numCblocks == 0, "Cblocks still open"); |
101 | LUA_ASSERT(L, L->nblocks == 0, "wrong count for nblocks"); | 101 | LUA_ASSERT(L->nblocks == 0, "wrong count for nblocks"); |
102 | LUA_ASSERT(L, L->Cstack.base == L->top, "C2Lua not empty"); | 102 | LUA_ASSERT(L->Cstack.base == L->top, "C2Lua not empty"); |
103 | luaM_free(L, L); | 103 | luaM_free(L, L); |
104 | if (L == lua_state) { | 104 | if (L == lua_state) { |
105 | LUA_ASSERT(L, memdebug_numblocks == 0, "memory leak!"); | 105 | LUA_ASSERT(memdebug_numblocks == 0, "memory leak!"); |
106 | LUA_ASSERT(L, memdebug_total == 0,"memory leak!"); | 106 | LUA_ASSERT(memdebug_total == 0,"memory leak!"); |
107 | lua_state = NULL; | 107 | lua_state = NULL; |
108 | } | 108 | } |
109 | } | 109 | } |