diff -r 525f85d9af37 -r aae5f448b508 sourcepawn/jit/sp_vm_basecontext.cpp --- a/sourcepawn/jit/sp_vm_basecontext.cpp Mon Jul 07 06:33:42 2008 +0000 +++ b/sourcepawn/jit/sp_vm_basecontext.cpp Tue Jul 08 07:59:33 2008 +0000 @@ -46,33 +46,13 @@ BaseContext::BaseContext(BaseRuntime *pRuntime) { m_pRuntime = pRuntime; + m_pPlugin = m_pRuntime->m_pPlugin; m_InExec = false; m_CustomMsg = false; - /* Initialize the null references */ - uint32_t index; - if (FindPubvarByName("NULL_VECTOR", &index) == SP_ERROR_NONE) - { - sp_pubvar_t *pubvar; - GetPubvarByIndex(index, &pubvar); - m_pNullVec = pubvar->offs; - } - else - { - m_pNullVec = NULL; - } - - if (FindPubvarByName("NULL_STRING", &index) == SP_ERROR_NONE) - { - sp_pubvar_t *pubvar; - GetPubvarByIndex(index, &pubvar); - m_pNullString = pubvar->offs; - } - else - { - m_pNullString = NULL; - } + m_pNullVec = NULL; + m_pNullString = NULL; } BaseContext::~BaseContext() @@ -668,6 +648,8 @@ RefreshFunctionCache(); + m_pCtx->Refresh(); + return SP_ERROR_NONE; } @@ -792,3 +774,30 @@ return true; } + +void BaseContext::Refresh() +{ + /* Initialize the null references */ + uint32_t index; + if (FindPubvarByName("NULL_VECTOR", &index) == SP_ERROR_NONE) + { + sp_pubvar_t *pubvar; + GetPubvarByIndex(index, &pubvar); + m_pNullVec = pubvar->offs; + } + else + { + m_pNullVec = NULL; + } + + if (FindPubvarByName("NULL_STRING", &index) == SP_ERROR_NONE) + { + sp_pubvar_t *pubvar; + GetPubvarByIndex(index, &pubvar); + m_pNullString = pubvar->offs; + } + else + { + m_pNullString = NULL; + } +}