opentk/opentk — pull request #158 by thefiddler (2014-07-22 19:09:49+00:00)
Title: [Mac] Improve stability under Cocoa

This PR fixes a number of resource leaks that would destabilize OpenTK after re-initialization. More specifically:
1. HIDInput now correctly destroys its IOHIDManager instance. Fixes input event being delivered to collected delegates
2. HIDInput now correctly retains its CFRunLoop instance.
3. `OpenTK.Toolkit.Init()` now re-initializes `OpenTK.Platform.Factory` even after a previous shutdown.
4. CocoaNativeWindow now correctly releases its window instance on shutdown.
5. CocoaNativeWindow no longer uses the Autorelease pool.

With this PR, a fuzz test of 100 GameWindow instances and/or Toolkit.Init calls now completes successfully.