1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Fix leaked ObjectRCs on object Variant reassignment

Bonus:
- Add some (un)likely magic
- Use memdelete() instead of memfree() (not strictly needed, but more correct)
This commit is contained in:
Pedro J. Estébanez
2020-06-28 01:27:03 +02:00
parent 6a9fbafcbb
commit dca653cc3a
2 changed files with 12 additions and 5 deletions

View File

@@ -1996,7 +1996,7 @@ Object::~Object() {
ObjectRC *rc = _rc.load(std::memory_order_acquire);
if (rc) {
if (rc->invalidate()) {
memfree(rc);
memdelete(rc);
}
}
#endif