mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
fix a bug
This commit is contained in:
parent
620e82f0ab
commit
31e24ca9bd
@ -73,7 +73,9 @@ struct PyBody{
|
||||
PyBody(): body(nullptr), fixture(nullptr), node_like(nullptr){}
|
||||
|
||||
void _gc_mark() {
|
||||
PK_OBJ_MARK(node_like);
|
||||
if(node_like != nullptr){
|
||||
PK_OBJ_MARK(node_like);
|
||||
}
|
||||
}
|
||||
|
||||
PyBody& _() { return *this; }
|
||||
|
@ -128,7 +128,7 @@ void PyBody::_register(VM* vm, PyObject* mod, PyObject* type){
|
||||
|
||||
// destroy
|
||||
vm->bind(type, "destroy(self)", [](VM* vm, ArgsView args){
|
||||
PyBody& body = CAST(PyBody&, args[1]);
|
||||
PyBody& body = CAST(PyBody&, args[0]);
|
||||
body.body->GetWorld()->DestroyBody(body.body);
|
||||
body.body = nullptr;
|
||||
body.fixture = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user