* fixed mem leak with texture manager
* minor refactorings