fixed memory leaks

deleting unused texture objects and preventing saving by using HideFlags