Fixed a lot of graphics allocation memory leaks.