Added destroy callbacks into context, fixed memory leak on Mac