fixed issue when allocating/disposing textures in onContextLost
added restoreOnContextLost