Fixed memory leak causing massive fps drops