mirror of
https://github.com/ChronosX88/mta-mono.git
synced 2024-11-22 10:12:20 +00:00
Добавлен CMonoDomain::ReleaseClass для удаления класса из пула. Добавлена ссылка на MonoInterface
This commit is contained in:
parent
de37d2bda1
commit
1dc1390070
@ -12,8 +12,9 @@
|
||||
|
||||
#include "CMonoDomain.h"
|
||||
|
||||
CMonoDomain::CMonoDomain( CResource* pResource, MonoDomain* pDomain )
|
||||
CMonoDomain::CMonoDomain( CMonoInterface* pMono, MonoDomain* pDomain, CResource* pResource )
|
||||
{
|
||||
this->m_pMono = pMono;
|
||||
this->m_pDomain = pDomain;
|
||||
this->m_pResource = pResource;
|
||||
|
||||
@ -63,6 +64,14 @@ CMonoClass* CMonoDomain::FindOrAdd( MonoClass* klass )
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void CMonoDomain::ReleaseClass( CMonoClass* pClass )
|
||||
{
|
||||
if( !this->m_ClassPool.empty() )
|
||||
{
|
||||
this->m_ClassPool.remove( pClass );
|
||||
}
|
||||
}
|
||||
|
||||
void CMonoDomain::Init( void )
|
||||
{
|
||||
this->m_pCorlib = new CMonoCorlib( this );
|
||||
|
@ -15,6 +15,7 @@ class CMonoDomain;
|
||||
#ifndef __CMONODOMAIN_H
|
||||
#define __CMONODOMAIN_H
|
||||
|
||||
#include "CMonoInterface.h"
|
||||
#include "CMonoCorlib.h"
|
||||
#include "CMonoMTALib.h"
|
||||
#include "CMonoClass.h"
|
||||
@ -27,17 +28,19 @@ class CMonoDomain
|
||||
private:
|
||||
MonoDomain* m_pDomain;
|
||||
CResource* m_pResource;
|
||||
CMonoInterface* m_pMono;
|
||||
|
||||
CMonoCorlib* m_pCorlib;
|
||||
CMonoMTALib* m_pMTALib;
|
||||
|
||||
vector< CMonoClass* > m_ClassPool;
|
||||
list< CMonoClass* > m_ClassPool;
|
||||
|
||||
public:
|
||||
CMonoDomain ( CResource* pResource, MonoDomain* pDomain );
|
||||
CMonoDomain ( CMonoInterface* pMono, MonoDomain* pDomain, CResource* pResource );
|
||||
~CMonoDomain ( void );
|
||||
|
||||
CMonoClass* FindOrAdd ( MonoClass* klass );
|
||||
void ReleaseClass ( CMonoClass* pClass );
|
||||
|
||||
void Init ( void );
|
||||
|
||||
@ -88,6 +91,7 @@ public:
|
||||
|
||||
MonoDomain* GetMonoPtr ( void ) { return this->m_pDomain; }
|
||||
|
||||
CMonoInterface* GetMono ( void ) { return this->m_pMono; }
|
||||
CResource* GetResource ( void ) { return this->m_pResource; }
|
||||
|
||||
CMonoCorlib* GetCorlib ( void ) { return this->m_pCorlib; }
|
||||
|
@ -43,7 +43,7 @@ CMonoDomain* CMonoInterface::CreateAppdomain( CResource* pResource, char* szName
|
||||
|
||||
if( pMonoDomain )
|
||||
{
|
||||
return new CMonoDomain( pResource, pMonoDomain );
|
||||
return new CMonoDomain( this, pMonoDomain, pResource );
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user