X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/fa7225c82381bac4432a6edf16f53b5370238d85..7e6b461318c8a779d91381531435a68ee4e8b6ed:/securityd/src/structure.cpp diff --git a/securityd/src/structure.cpp b/securityd/src/structure.cpp index 80bcb054..3c5dc50f 100644 --- a/securityd/src/structure.cpp +++ b/securityd/src/structure.cpp @@ -33,11 +33,13 @@ // but its dump support is conditionally included. // NodeCore::~NodeCore() -{ +try { #if defined(DEBUGDUMP) StLock _(mCoreLock); mCoreNodes.erase(this); #endif //DEBUGDUMP +} catch(...) { + return; } @@ -60,8 +62,6 @@ void NodeCore::referent(NodeCore &r) void NodeCore::clearReferent() { StLock _(*this); - if (mReferent) - assert(!mReferent->hasReference(*this)); mReferent = NULL; } @@ -76,21 +76,9 @@ void NodeCore::addReference(NodeCore &p) void NodeCore::removeReference(NodeCore &p) { StLock _(*this); - assert(hasReference(p)); mReferences.erase(&p); } -#if !defined(NDEBUG) - -bool NodeCore::hasReference(NodeCore &p) -{ - assert(p.refCountForDebuggingOnly() > 0); - return mReferences.find(&p) != mReferences.end(); -} - -#endif //NDEBUG - - // // ClearReferences clears the reference set but does not propagate // anything; it is NOT recursive. @@ -98,8 +86,7 @@ bool NodeCore::hasReference(NodeCore &p) void NodeCore::clearReferences() { StLock _(*this); - secinfo("ssnode", "%p clearing all %d references", - this, int(mReferences.size())); + secinfo("ssnode", "%p clearing all %d references", this, int(mReferences.size())); mReferences.erase(mReferences.begin(), mReferences.end()); } @@ -123,7 +110,6 @@ void NodeCore::kill() void NodeCore::kill(NodeCore &ref) { StLock _(*this); - assert(hasReference(ref)); ref.kill(); removeReference(ref); }