X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/313fa17b58b78d3c26fb986be9e8fce975cec88c..420ff9d9379a8d93f2c90f026a797bdea1eb4517:/libsecurity_cdsa_client/lib/cssmclient.cpp diff --git a/libsecurity_cdsa_client/lib/cssmclient.cpp b/libsecurity_cdsa_client/lib/cssmclient.cpp index a86f3bde..dc091bb5 100644 --- a/libsecurity_cdsa_client/lib/cssmclient.cpp +++ b/libsecurity_cdsa_client/lib/cssmclient.cpp @@ -30,7 +30,7 @@ // and thus don't need to be interlocked explicitly. // #include - +#include using namespace CssmClient; @@ -77,8 +77,11 @@ ObjectImpl::ObjectImpl(const Object &mommy) : mParent(mommy.mImpl), mChildCount( ObjectImpl::~ObjectImpl() try { - assert(!mActive); // subclass must have deactivated us - assert(isIdle()); + if (!isIdle()) + { + int i = mChildCount; + syslog(LOG_ALERT, "Object %p still has %d children at delete.\n", this, i); + } // release parent from her obligations (if we still have one) if (mParent) @@ -398,25 +401,29 @@ ModuleImpl::appNotifyCallback(RawModuleEvents *handler) void ModuleImpl::activate() { - StLock _(mActivateMutex); - if (!mActive) - { - session()->init(); - // @@@ install handler here (use central dispatch with override) - secdebug("callback","In ModuleImpl::activate, mAppNotifyCallback=%p, mAppNotifyCallbackCtx=%p", - mAppNotifyCallback, mAppNotifyCallbackCtx); - check(CSSM_ModuleLoad(&guid(), CSSM_KEY_HIERARCHY_NONE, mAppNotifyCallback, mAppNotifyCallbackCtx)); - mActive = true; - session()->catchExit(); - } + { + StLock _(mActivateMutex); + if (!mActive) + { + session()->init(); + // @@@ install handler here (use central dispatch with override) + secdebug("callback","In ModuleImpl::activate, mAppNotifyCallback=%p, mAppNotifyCallbackCtx=%p", + mAppNotifyCallback, mAppNotifyCallbackCtx); + check(CSSM_ModuleLoad(&guid(), CSSM_KEY_HIERARCHY_NONE, mAppNotifyCallback, mAppNotifyCallbackCtx)); + mActive = true; + } + } + + session()->catchExit(); } void ModuleImpl::deactivate() { - StLock _(mActivateMutex); if (!isIdle()) Error::throwMe(Error::objectBusy); + + StLock _(mActivateMutex); if (mActive) { mActive = false;