shoes/shoes4 — pull request #693 by jasonrclark (2014-05-08 19:10:25+00:00)
Title: Releasing Swt::Graphics::Color resources

**WIP: Putting up for comment, but not ready for merging yet**

While we've dealt with the biggest culprits of leaks in text-based apps, we still have other leaking SWT resources. One of the bigger ones is colors.

The current state of things takes a quick swipe at handling some basic leakage I was seeing as a result of `fill` and `stroke` settings.

Felt a little repetitive, but also odd to have the `Shoes::Swt::Common::Fill` module (and others) be aware of the `Shoes::Swt::Common::Clear#mark_to_dispose`... made me feel like the abstractions might not be quite right in what I'm doing. Maybe things would be easier with a designated `ColorFactory` like we have for fonts and styles over in text-land. Someone still has to manage the factory instance, but that might be better than having the `Common::Clear` module be responsible for that. Anyone else have thoughts on that?

Plenty still left to do:

- [ ] Find other places that instantiate colors and track them
- [ ] Reduce duplication
- [ ] Specs please
- [ ] Fill/Stroke both needlessly allocate new SWT-level colors on every paint, even when the DSL color didn't change. Could reduce overhead on that a lot if we created fewer (and make any potentially missed leak less disastrous)