This commit is contained in:
2024-12-18 12:52:31 +08:00
parent 8cb187e395
commit 167fedb776
2 changed files with 3 additions and 12 deletions

View File

@@ -27,14 +27,9 @@ abstract class JSRef {
_refCount++;
}
bool _released = false;
void free() {
_refCount--;
if (_refCount < 0 && !_released){
_released = true;
destroy();
}
if (_refCount < 0) destroy();
}
void destroy();