Add object to world exception

Started by gamenewer, March 02, 2015, 05:44:12 AM

Previous topic - Next topic

gamenewer

Hellow Egon, I  add objects to world , but sometimes get error

03-02 12:39:44.920: E/AndroidRuntime(5259): FATAL EXCEPTION: GLThread 13
03-02 12:39:44.920: E/AndroidRuntime(5259): java.lang.NullPointerException
03-02 12:39:44.920: E/AndroidRuntime(5259):    at com.threed.jpct.Object3DList.contains(Object3DList.java:83)
03-02 12:39:44.920: E/AndroidRuntime(5259):    at com.threed.jpct.World.addObject(World.java:325)

not always ,sometimes is ok ,but some times is error .   

EgonOlsen

This can only happen if one of the objects in the list is null. This can either happen if you are adding null objects or you are adding and removing objects in different threads. jPCT-AE isn't thread safe. Don't add/remove any objects from outside the rendering thread: http://www.jpct.net/wiki/index.php/Thread_safety

gamenewer