Skip to content

Commit

Permalink
fix extra ctor call for module/chugin import
Browse files Browse the repository at this point in the history
  • Loading branch information
gewang committed Dec 1, 2023
1 parent eb0cefb commit 8d7b638
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/core/chuck_scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2904,6 +2904,8 @@ t_CKBOOL type_engine_scan2_func_def( Chuck_Env * env, a_Func_Def f )
func->code = new Chuck_VM_Code;
// add reference
CK_SAFE_ADD_REF( func->code );
// add name | 1.5.2.0
func->code->name = S_name(f->name);
// copy the native code, for imported functions
if( f->s_type == ae_func_builtin )
{
Expand Down
4 changes: 2 additions & 2 deletions src/core/chuck_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8612,7 +8612,7 @@ t_CKBOOL type_engine_add_class_from_dl( Chuck_Env * env, Chuck_DL_Class * c )
// begin import as ugen
if( !type_engine_import_ugen_begin( env, c->name.c_str(),
c->parent.c_str(), env->global(),
ctor ? ctor->ctor : NULL,
NULL, // ctor ? ctor->ctor : NULL, // ctors from DL added as type_engine_import_ctor()
dtor ? dtor->dtor : NULL,
c->ugen_tick, c->ugen_tickf, c->ugen_pmsg,
c->ugen_num_in, c->ugen_num_out,
Expand All @@ -8624,7 +8624,7 @@ t_CKBOOL type_engine_add_class_from_dl( Chuck_Env * env, Chuck_DL_Class * c )
// begin import as normal class (non-ugen)
if( !type_engine_import_class_begin( env, c->name.c_str(),
c->parent.c_str(), env->global(),
ctor ? ctor->ctor : NULL,
NULL, // ctor ? ctor->ctor : NULL, // ctors from DL added as type_engine_import_ctor()
dtor ? dtor->dtor : NULL,
c->doc.length() > 0 ? c->doc.c_str() : NULL ) )
goto error;
Expand Down

0 comments on commit 8d7b638

Please sign in to comment.