Berry fix typo

This commit is contained in:
Stephan Hadinger 2022-06-15 22:23:22 +02:00
parent f10c7f06bf
commit 6b0fbf0798
3 changed files with 6 additions and 6 deletions

View File

@ -46,14 +46,14 @@ bvalue* be_indexof(bvm *vm, int idx)
return vm->top + idx;
}
BERRY_API void be_newcomobj(bvm *vm, void *data, bntvfunc destory)
BERRY_API void be_newcomobj(bvm *vm, void *data, bntvfunc destroy)
{
bcommomobj *obj;
bgcobject *gco = be_gcnew(vm, BE_COMOBJ, bcommomobj);
if ((obj = cast_comobj(gco)) != NULL) {
bvalue* top = be_incrtop(vm);
obj->data = data;
obj->destory = destory;
obj->destroy = destroy;
var_setobj(top, BE_COMOBJ, obj);
}
}
@ -62,8 +62,8 @@ void be_commonobj_delete(bvm *vm, bgcobject *obj)
{
bcommomobj *co = cast_comobj(obj);
if (co) {
if (co->destory && co->data) {
be_pushntvfunction(vm, co->destory);
if (co->destroy && co->data) {
be_pushntvfunction(vm, co->destroy);
be_pushcomptr(vm, co->data);
be_call(vm, 1);
be_pop(vm, 2);

View File

@ -191,7 +191,7 @@ struct bntvclos {
typedef struct {
bcommon_header;
void *data;
bntvfunc destory;
bntvfunc destroy;
} bcommomobj;
typedef const char* (*breader)(void*, size_t*);

View File

@ -499,7 +499,7 @@ BERRY_API bbool be_pushiter(bvm *vm, int index);
BERRY_API void be_newlist(bvm *vm);
BERRY_API void be_newmap(bvm *vm);
BERRY_API void be_newmodule(bvm *vm);
BERRY_API void be_newcomobj(bvm *vm, void *data, bntvfunc destory);
BERRY_API void be_newcomobj(bvm *vm, void *data, bntvfunc destroy);
BERRY_API void be_newobject(bvm *vm, const char *name);
BERRY_API bbool be_copy(bvm *vm, int index);
BERRY_API bbool be_setname(bvm *vm, int index, const char *name);