GameMonkey Script

GameMonkey Script Forums
It is currently Mon Mar 18, 2019 8:06 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Jun 18, 2004 12:00 pm 
Offline

Joined: Mon Dec 15, 2003 1:38 pm
Posts: 708
Trepan has brought to our attention the fact that the error log is being repeatedly reset when threads are created and destroyed, which in some apps is very frequent and away from the code that periodically polls for errors. The solution is to remove the lines of code that reset the error log and manually reset the log after handling the errors.

Remove lines that look like:
Code:
m_machine->GetLog().Reset();

from gmthread.cpp
gmThread::Sys_Execute()

and

Code:
m_log.Reset();

from gmMachine.cpp
gmMachine::CheckSyntax()
gmMachine::ExecuteString()
gmMachine::CompileStringToLib()
gmMachine::CompileStringToFunction()

Your existing code may look like this bit from GME:
Code:
bool first = true;
const char * entry;
while((entry = a_machine->GetLog().GetEntry(first)))
{
  fprintf(stderr, "%s", entry);
}

Straight after that, add the line:
Code:
a_machine->GetLog().Reset();


Now you shouldn't miss any error messages.

I believe the reason most users havn't discovered this issue is because they handle the MC_THREAD_EXCEPTION message from the gmMachine callback. This message is sent whenever an exception occurs.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group