Пример #1
0
	/*! Remove a T* from the manager; destroys the object
	  \param name session name
	  \return true if successful */
	bool remove(const f8String& name)
	{
		f8_scoped_lock guard(_mutex);
		auto itr(_sessionmap.find(name));
		if (itr == _sessionmap.end())
			return false;
		delete itr->second;
		_sessionmap.erase(itr);
		return true;
	}
Пример #2
0
CK_RV CKManager::RemoveSession(CK_SESSION_HANDLE hSession)
{
	// Check that the library is initialized
	if (!m_isInitialized)
		return CKR_CRYPTOKI_NOT_INITIALIZED;

	// Erase the session from the map, return an error if not present
	if (m_sessionMap.erase(hSession) == 0)
		return CKR_SESSION_HANDLE_INVALID;

	return CKR_OK;
}
Пример #3
0
 ~MemorySessionStore() {
     // Delete all the sessions but while locked
     lock_guard<shared_mutex> lock(_lock);
     sessions.erase(sessions.begin(), sessions.end());
 }