Skip to content

Commit

Permalink
Object: Let debug lock handle callee destruction within call chain gr…
Browse files Browse the repository at this point in the history
…acefully
  • Loading branch information
RandomShaper committed Sep 11, 2024
1 parent 97ef3c8 commit 05e3c71
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,18 @@
#ifdef DEBUG_ENABLED

struct _ObjectDebugLock {
Object *obj;
Variant obj;

_ObjectDebugLock(Object *p_obj) {
obj = p_obj;
obj->_lock_index.ref();
p_obj->_lock_index.ref();
}
~_ObjectDebugLock() {
obj->_lock_index.unref();
bool freed = false;
Object *obj_ptr = obj.get_validated_object_with_check(freed);
if (obj_ptr) {
obj_ptr->_lock_index.unref();
}
}
};

Expand Down

0 comments on commit 05e3c71

Please sign in to comment.