Fix leak with multi-output primitives (#1274)

* fix leak with multi-output primitives

* hopefully an actual fix
This commit is contained in:
Awni Hannun
2024-07-23 06:34:18 -07:00
committed by GitHub
parent df124e018a
commit 1fba87b0df
4 changed files with 29 additions and 5 deletions

View File

@@ -175,10 +175,11 @@ array::~array() {
return;
}
// Ignore arrays that will be detached
if (status() != array::Status::unscheduled) {
// Ignore arrays that might be detached during eval
if (status() == array::Status::scheduled) {
return;
}
// Break circular reference for non-detached arrays with siblings
if (auto n = siblings().size(); n > 0) {
bool do_detach = true;