Files
2022-10-26 12:25:11 +08:00

33 lines
676 B
C++

#include "StdAfx.h"
#include ".\updateagentsessionfactory.h"
UpdateAgentSessionFactory::UpdateAgentSessionFactory(void)
{
}
UpdateAgentSessionFactory::~UpdateAgentSessionFactory(void)
{
}
VOID UpdateAgentSessionFactory::Init( DWORD dwMaxUserCount )
{
if( !m_pAgentSessionPool )
{
delete m_pAgentSessionPool;
m_pAgentSessionPool = NULL;
}
m_pAgentSessionPool = new MemoryPool<UpdateAgentSession>(dwMaxUserCount);
}
Session* UpdateAgentSessionFactory::AllocSession()
{
return m_pAgentSessionPool->Alloc();
}
VOID UpdateAgentSessionFactory::Free( Session* pSession )
{
if( !pSession ) return;
m_pAgentSessionPool->Restore( (UpdateAgentSession*)pSession );
}