enthought / traits-enaml

A library to facilitate interoperation of Traits with Enaml > 0.8.x
Other
15 stars 11 forks source link

Make sure the TraitsUI control is destroyed then the Enaml object is. #19

Closed pberkes closed 10 years ago

pberkes commented 10 years ago

I wasn't able to create a minimal failing example, but this caused a segfault in a UI in a customer project.

In some configuration, the segfault was preceeded by this error message:

<type 'exceptions.AttributeError'>: 'TabularModel' object has no attribute '_editor'
Error in sys.excepthook:
Traceback (most recent call last):
  File "/Users/pberkes/.../logger.py", line 185, in _log_uncaught_exceptions
    raise exception
AttributeError: 'TabularModel' object has no attribute '_editor'

We arrived at that point through

'headerData' called from:
   _run_exitfuncs (/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/atexit.py: 24)
      func(*targs, **kargs)
   destroy_all (/Users/pberkes/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/matplotlib/_pylab_helpers.py: 90)
      gc.collect()
rkern commented 10 years ago

LGTM.

pberkes commented 10 years ago

@sjagoe @itziakos Revised according to your feedback, and added a test. Comments welcome... am I on the right track?

sjagoe commented 10 years ago

I think that looks about right.

itziakos commented 10 years ago

Thanks @pberkes and @sjagoe.

Please update dev_requirements.txt to add traitsui into the mix. As soon as Travis gives the ok, this pr should be merged.

itziakos commented 10 years ago

:+1: