// and thus don't need to be interlocked explicitly.
//
#include <security_cdsa_client/cssmclient.h>
-
+#include <syslog.h>
using namespace CssmClient;
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)
void
ModuleImpl::activate()
{
- StLock<Mutex> _(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<Mutex> _(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<Mutex> _(mActivateMutex);
if (!isIdle())
Error::throwMe(Error::objectBusy);
+
+ StLock<Mutex> _(mActivateMutex);
if (mActive)
{
mActive = false;