Simulator fix: After main loop, NSApplication  needs to be terminated immediately.
GLView::end needs to release self.
Merge pull request #5737 from dumganhar/runtime-fix

Lua Runtime fix