From: Jérémie Astor Date: Sun, 23 Feb 2020 22:08:59 +0000 (+0100) Subject: :Fix module behavior X-Git-Tag: nightly~1731 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ac3391938c697fd41166fd9e41fa0d41c1fbd708;p=gwion.git :Fix module behavior --- diff --git a/src/gwion.c b/src/gwion.c index 1b816c77..df61ac10 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -74,11 +74,13 @@ ANN static void gwion_core(const Gwion gwion) { ANN static m_bool gwion_ok(const Gwion gwion, Arg* arg) { gwion->data->plug = new_pluginfo(gwion->mp, &arg->lib); shreduler_set_loop(gwion->vm->shreduler, arg->loop); - if(gwion_audio(gwion) > 0 && gwion_engine(gwion)) { - gwion_cleaner(gwion); + if(gwion_audio(gwion) > 0) { plug_run(gwion, &arg->mod); - gwion_compile(gwion, &arg->add); - return GW_OK; + if(gwion_engine(gwion)) { + gwion_cleaner(gwion); + gwion_compile(gwion, &arg->add); + return GW_OK; + } } return GW_ERROR; } diff --git a/tests/import/get_module.c b/tests/import/get_module.c index d0ecf040..d4d11e62 100644 --- a/tests/import/get_module.c +++ b/tests/import/get_module.c @@ -17,15 +17,15 @@ GWMODSTR(dummy_module); GWMODINI(dummy_module) { puts(__func__); - return NULL; + return (void*)2; // we need to return something } GWMODEND(dummy_module) { puts(__func__); } GWION_IMPORT(dummy_module) { - GWI_OB(get_module(gwi->gwion, "dummy_module")) - puts("test passed!"); + CHECK_OB(get_module(gwi->gwion, "dummy_module")) + puts("test passed"); get_module(gwi->gwion, "non_existant_module"); return GW_OK; }