diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/sledjchisl/sledjchisl.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/sledjchisl/sledjchisl.c b/src/sledjchisl/sledjchisl.c index 8939e2b..23f47a1 100644 --- a/src/sledjchisl/sledjchisl.c +++ b/src/sledjchisl/sledjchisl.c | |||
@@ -957,17 +957,20 @@ void freeLuaTree(qtreetbl_t *tree) | |||
957 | { | 957 | { |
958 | qtreetbl_obj_t obj0; | 958 | qtreetbl_obj_t obj0; |
959 | 959 | ||
960 | memset((void*)&obj0, 0, sizeof(obj0)); // must be cleared before call | 960 | if(tree) |
961 | tree->lock(tree); // lock it when thread condition is expected | ||
962 | while(tree->getnext(tree, &obj0, false) == true) | ||
963 | { | 961 | { |
964 | qLua *q0 = obj0.data; | 962 | memset((void*)&obj0, 0, sizeof(obj0)); // must be cleared before call |
963 | tree->lock(tree); // lock it when thread condition is expected | ||
964 | while(tree->getnext(tree, &obj0, false) == true) | ||
965 | { | ||
966 | qLua *q0 = obj0.data; | ||
965 | 967 | ||
966 | if (LUA_TTABLE == q0->type) | 968 | if (LUA_TTABLE == q0->type) |
967 | freeLuaTree(q0->v.t); | 969 | freeLuaTree(q0->v.t); |
970 | } | ||
971 | tree->unlock(tree); | ||
972 | tree->free(tree); | ||
968 | } | 973 | } |
969 | tree->unlock(tree); | ||
970 | tree->free(tree); | ||
971 | } | 974 | } |
972 | 975 | ||
973 | 976 | ||