improves memory usage (prevents memory leaks on texture generation)