enthought/traitsui — pull request #121 by rkern (2013-07-10 10:03:11+00:00)
Title: BUG: Keep UI instances alive when `configure_traits()` is called while an event loop is running

`configure_traits()` returns the `.result` of the dialog it raises. In normal use, where `configure_traits()` also starts up the event loop, this is fine, as it will only return control after the UI event loop has completed. When the event loop has already been started, it returns without keeping any reference to the `traitsui.ui.UI` instance that keeps the dialog alive. Only the tangled nest of cyclical references keeps it alive until the garbage collector happens to clean it up. This PR keeps references to these `UI` instances until they are destroyed through the normal GUI interactions that dispose of the dialog.