From: Jérémie Astor Date: Mon, 2 Dec 2019 22:24:25 +0000 (+0100) Subject: :art: Use gwion for clean2 X-Git-Tag: nightly~2070^2~12 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=eb30db6d7dedd0490e2a04f388d5044d4d21a221;p=gwion.git :art: Use gwion for clean2 --- diff --git a/src/gwion.c b/src/gwion.c index 4bb4c9db..8589d676 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -113,8 +113,8 @@ ANN static inline void free_gwion_cpy(const Gwion gwion, const VM_Shred shred) { ANN static void fork_clean2(const VM_Shred shred, const Vector v) { for(m_uint i = 0; i < vector_size(v); ++i) { - VM* vm = (VM*)vector_at(v, i); - free_gwion_cpy(vm->gwion, shred); + const Gwion gwion = (Gwion)vector_at(v, i); + free_gwion_cpy(gwion, shred); } vector_release(v); } diff --git a/src/lib/shred.c b/src/lib/shred.c index fd430fba..f25f028f 100644 --- a/src/lib/shred.c +++ b/src/lib/shred.c @@ -154,7 +154,7 @@ static DTOR(fork_dtor) { vector_rem2(&vm->gwion->data->child, (vtype)o); if(!vm->gwion->data->child2.ptr) vector_init(&vm->gwion->data->child2); - vector_add(&vm->gwion->data->child2, (vtype)ME(o)->info->vm); + vector_add(&vm->gwion->data->child2, (vtype)ME(o)->info->vm->gwion); } } diff --git a/tests/import/test.log b/tests/import/test.log new file mode 100644 index 00000000..23d7fa2b --- /dev/null +++ b/tests/import/test.log @@ -0,0 +1,15 @@ +op_already_imported.gw ==964533== Memcheck, a memory error detector +==964533== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. +==964533== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info +==964533== Command: ./../../gwion -p. -m dummy -d dummy op_already_imported.gw +==964533== Parent PID: 963027 +==964533== +==964533== +==964533== HEAP SUMMARY: +==964533== in use at exit: 0 bytes in 0 blocks +==964533== total heap usage: 869 allocs, 869 frees, 17,602,040 bytes allocated +==964533== +==964533== All heap blocks were freed -- no leaks are possible +==964533== +==964533== For lists of detected and suppressed errors, rerun with: -s +==964533== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)