Unity version : 4.6.0f3
Smartfox client version :1.5.5
Windows Phone version : 8.1
I am unity c# developer.Randomly i got 'Access violation' error, after game crashed on Windows Phone 8.1 . I cant not debug or handle this error in visual studio because game crashes immediatelly
No problem in IOS and Android.
I searched on google and find some conversation :
http://forum.unity3d.com/threads/callba ... in.214492/
It says you have to use this code for callback in plugin,
UnityApp.BeginInvoke(() =>
{
// back to Unity
}, false);
and I found this:
http://www.slideshare.net/282production ... -windows-8
Check slide 17.
Error is here:
Thread has exited with code -1073741819 (0xc0000005) 'Access violation'.
I dont know exactly maybe this error occur when smartfox try to call event listeners in unity ?
Access Violation WP8 Using Unity
-
Eser Telekom
- Posts: 25
- Joined: 16 Oct 2014, 07:28
- Location: Istanbul
- Contact:
Re: Access Violation WP8 Using Unity
It is hard to say what might be going on without additional details on the issue (for example, upon which event it happens).
I would like to suggest a test: after instantiating the SmartFox class, make sure you set the ThreadSafeMode to true explicitly.
Does this change the behavior?
The reason is that ThreadSafeMode's default value is "true" in the SFS API for Unity, but it is "false" in the API for WP8. This is needed for native WP8 or Win8 apps, but as you are exporting from Unity, you might need to set it back to "true" explicitly.
I would like to suggest a test: after instantiating the SmartFox class, make sure you set the ThreadSafeMode to true explicitly.
Does this change the behavior?
The reason is that ThreadSafeMode's default value is "true" in the SFS API for Unity, but it is "false" in the API for WP8. This is needed for native WP8 or Win8 apps, but as you are exporting from Unity, you might need to set it back to "true" explicitly.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team
-
Eser Telekom
- Posts: 25
- Joined: 16 Oct 2014, 07:28
- Location: Istanbul
- Contact:
Re: Access Violation WP8 Using Unity
Yes. It ' s fixed.When ThreadSafeMode is false , game is crashed randomly. Example Code here : Dont forget to write "smartFox.ThreadSafeMode = true;"
SmartFox smartFox = new SmartFox();
#if UNITY_WP8 || UNITY_METRO
smartFox.ThreadSafeMode = true;
#endif
SmartFox smartFox = new SmartFox();
#if UNITY_WP8 || UNITY_METRO
smartFox.ThreadSafeMode = true;
#endif
Re: Access Violation WP8 Using Unity
We will make sure to add a note in the documentation. Thanks.
Paolo Bax
The SmartFoxServer Team
The SmartFoxServer Team