X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/b1ab9ed8d0e0f1c3b66d7daa8fd5564444c56195..420ff9d9379a8d93f2c90f026a797bdea1eb4517:/libsecurity_utilities/lib/cfclass.cpp diff --git a/libsecurity_utilities/lib/cfclass.cpp b/libsecurity_utilities/lib/cfclass.cpp index cfd80514..d635ca44 100644 --- a/libsecurity_utilities/lib/cfclass.cpp +++ b/libsecurity_utilities/lib/cfclass.cpp @@ -103,9 +103,17 @@ CFClass::cleanupObject(intptr_t op, CFTypeRef cf, bool &zap) } else if (currentCount == 0) { - finalizeType(cf); - zap = true; // the the caller to release the mutex and zap the object - return 0; + // we may not be able to delete if the caller has active children + if (obj->mayDelete()) + { + finalizeType(cf); + zap = true; // ask the caller to release the mutex and zap the object + return 0; + } + else + { + return currentCount; + } } else {