Fixed memory leak for new Context code