mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-29 06:07:57 +03:00
Added script traces
This commit is contained in:
parent
b291ab92b6
commit
f01a0a17c1
3 changed files with 33 additions and 11 deletions
|
@ -2265,17 +2265,27 @@ ScriptThread::ScriptThread(ScriptClass *scriptClass, unsigned char *pCodePos)
|
|||
m_ScriptVM = new ScriptVM(scriptClass, pCodePos, this);
|
||||
|
||||
m_ScriptVM->m_ThreadState = THREAD_RUNNING;
|
||||
|
||||
if (g_scripttrace->integer && CanScriptTracePrint()) {
|
||||
gi.DPrintf2("+++Constructor THREAD: %p %p\n", this, scriptClass);
|
||||
}
|
||||
}
|
||||
|
||||
ScriptThread::~ScriptThread()
|
||||
{
|
||||
ScriptVM *vm = m_ScriptVM;
|
||||
assert(vm);
|
||||
if (!vm) {
|
||||
ScriptVM* vm;
|
||||
|
||||
if (g_scripttrace->integer && CanScriptTracePrint()) {
|
||||
gi.DPrintf2("---Destructor THREAD: %p\n\n", this);
|
||||
}
|
||||
|
||||
assert(m_ScriptVM);
|
||||
if (!m_ScriptVM) {
|
||||
// should never happen
|
||||
throw ScriptException("Attempting to delete a dead thread.");
|
||||
}
|
||||
|
||||
vm = m_ScriptVM;
|
||||
m_ScriptVM = NULL;
|
||||
if (vm->ThreadState() == THREAD_WAITING) {
|
||||
vm->m_ThreadState = THREAD_RUNNING;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue