shoes/shoes4 — pull request #682 by jasonrclark (2014-05-06 21:59:56+00:00)
Title: Adding leak hunter for running down SWT resource leaks

In running down the SWT resource leaks, I came up with an idea for how to more easily isolate leaks. This PR helps find usages of SWT classes that we're instantiating that aren't getting disposed explicitly (which is our main problem)

Usage of this requires adding the following line in your Shoes app:

```
require 'shoes/swt/leak_hunter'
```

When the app exits, it dumps stack traces where SWT classes were created, along with counts and class names from undisposed SWT instances we've identified.

**Caveats** Any resources still held when the app exits show up in the list, so there is some noise. You can fix that in your app by adding a quit button or something that explicitly clears out the display before quitting. Considering patching in a hook into the Shoes app so we can directly do that from our `at_exit` in the leak hunter, but wanted to get this out there first.

This only currently works against three classes we've identified: `Swt::Graphics::Color`, `Swt::Graphics::Font` and `Swt::TextLayout`. We can easily add other classes to the list, although it'd also be super-cool if we could walk the `Swt` modules and cram this onto any class that has a `dispose` method on it.

:bug: :hammer: :boom: