Page 1 of 1

m_ThreadCheck && !Thread::EqualsCurrentThreadID(m_Th

Posted: 30 Dec 2010, 20:22
by Fishypants
Hey, I am getting this error:

m_ThreadCheck && !Thread::EqualsCurrentThreadID(m_ThreadID)
Error in file: ..\..\Runtime\Utilities\MemoryPool.cpp at line 117

What I am doing is basically recreating the island demo piece by piece. I have created a custom login and I get this error after I switch scenes. Unfortunately I have no idea of what or where this error belongs to.

One hunch I am having is that I know I need to assign myUserName and myUserId if I am using a custom login, right? Could this be the culprit?

Posted: 30 Dec 2010, 21:55
by ThomasLund
One hunch I have would be that you do not run the API in threadsafe mode (the queue mode, where you poll the API for responses in e.g. FixedUpdate)

Unity is not thread safe, and the API uses a separate thread to handle the network communication.

Basically all Unity usage of the SFS1 API should run in the queue mode. SFS2X defaults to this - but SFS1 doesnt due to historical reasons.

/T

Posted: 30 Dec 2010, 21:57
by Fishypants
Thanks for the reply Thomas,
How would I go about running it in threadsafe mode?

Posted: 31 Dec 2010, 08:35
by ThomasLund
You need to do something like

smartFox = new SmartFoxClient();
smartFox.runInQueueMode = true;

void FixedUpdate() {
smartFox.ProcessEventQueue();
}