sourcepawn/jit/sp_vm_basecontext.cpp
branchrefac-jit
changeset 2180 aae5f448b508
parent 2174 01c5adfae757
child 2188 24b170ea6ce7
     1.1 --- a/sourcepawn/jit/sp_vm_basecontext.cpp	Mon Jul 07 06:33:42 2008 +0000
     1.2 +++ b/sourcepawn/jit/sp_vm_basecontext.cpp	Tue Jul 08 07:59:33 2008 +0000
     1.3 @@ -46,33 +46,13 @@
     1.4  BaseContext::BaseContext(BaseRuntime *pRuntime)
     1.5  {
     1.6  	m_pRuntime = pRuntime;
     1.7 +	m_pPlugin = m_pRuntime->m_pPlugin;
     1.8  
     1.9  	m_InExec = false;
    1.10  	m_CustomMsg = false;
    1.11  
    1.12 -	/* Initialize the null references */
    1.13 -	uint32_t index;
    1.14 -	if (FindPubvarByName("NULL_VECTOR", &index) == SP_ERROR_NONE)
    1.15 -	{
    1.16 -		sp_pubvar_t *pubvar;
    1.17 -		GetPubvarByIndex(index, &pubvar);
    1.18 -		m_pNullVec = pubvar->offs;
    1.19 -	}
    1.20 -	else
    1.21 -	{
    1.22 -		m_pNullVec = NULL;
    1.23 -	}
    1.24 -
    1.25 -	if (FindPubvarByName("NULL_STRING", &index) == SP_ERROR_NONE)
    1.26 -	{
    1.27 -		sp_pubvar_t *pubvar;
    1.28 -		GetPubvarByIndex(index, &pubvar);
    1.29 -		m_pNullString = pubvar->offs;
    1.30 -	}
    1.31 -	else
    1.32 -	{
    1.33 -		m_pNullString = NULL;
    1.34 -	}
    1.35 +	m_pNullVec = NULL;
    1.36 +	m_pNullString = NULL;
    1.37  }
    1.38  
    1.39  BaseContext::~BaseContext()
    1.40 @@ -668,6 +648,8 @@
    1.41  
    1.42  	RefreshFunctionCache();
    1.43  
    1.44 +	m_pCtx->Refresh();
    1.45 +
    1.46  	return SP_ERROR_NONE;
    1.47  }
    1.48  
    1.49 @@ -792,3 +774,30 @@
    1.50  
    1.51  	return true;
    1.52  }
    1.53 +
    1.54 +void BaseContext::Refresh()
    1.55 +{
    1.56 +	/* Initialize the null references */
    1.57 +	uint32_t index;
    1.58 +	if (FindPubvarByName("NULL_VECTOR", &index) == SP_ERROR_NONE)
    1.59 +	{
    1.60 +		sp_pubvar_t *pubvar;
    1.61 +		GetPubvarByIndex(index, &pubvar);
    1.62 +		m_pNullVec = pubvar->offs;
    1.63 +	}
    1.64 +	else
    1.65 +	{
    1.66 +		m_pNullVec = NULL;
    1.67 +	}
    1.68 +
    1.69 +	if (FindPubvarByName("NULL_STRING", &index) == SP_ERROR_NONE)
    1.70 +	{
    1.71 +		sp_pubvar_t *pubvar;
    1.72 +		GetPubvarByIndex(index, &pubvar);
    1.73 +		m_pNullString = pubvar->offs;
    1.74 +	}
    1.75 +	else
    1.76 +	{
    1.77 +		m_pNullString = NULL;
    1.78 +	}
    1.79 +}