diff --git a/lang/main.c b/lang/main.c index d38e1d7..a42c71d 100644 --- a/lang/main.c +++ b/lang/main.c @@ -26,6 +26,7 @@ static void test_module(VmState state) { Object module = module_find(state, "Main"); + modules_free(state); vm_stack_push(state, object_none()); vm_call(state, module, "MakeNumber", 1); Object ratioA = vm_stack_pop(state); @@ -62,7 +63,6 @@ VmState state = vm_create(); test_rational(state); test_module(state); - modules_free(state); vm_destroy(&state); printf("All done!\n"); return 0;