]> git.saurik.com Git - apple/security.git/blobdiff - Keychain/Keychains.cpp
Security-54.1.5.tar.gz
[apple/security.git] / Keychain / Keychains.cpp
index a525446845a275c6009f155ff89edfdcd4f49129..e818051b4f0000afcee22552af3c2f99d20d2409 100644 (file)
@@ -618,6 +618,18 @@ KeychainImpl::addItem(const PrimaryKey &primaryKey, ItemImpl *dbItemImpl)
        mDbItemMap.insert(DbItemMap::value_type(primaryKey, dbItemImpl));
 }
 
+void
+KeychainImpl::didDeleteItem(const ItemImpl *inItemImpl)
+{
+       // Sent sent by CCallbackMgr.
+    debug("kcnotify", "%p notified that item %p was deleted", this, inItemImpl);
+       PrimaryKey primaryKey = inItemImpl->primaryKey();
+       StLock<Mutex> _(mDbItemMapLock);
+       DbItemMap::iterator it = mDbItemMap.find(primaryKey);
+       if (it != mDbItemMap.end())
+               mDbItemMap.erase(it);
+}
+
 void
 KeychainImpl::removeItem(const PrimaryKey &primaryKey, const ItemImpl *inItemImpl)
 {