Re: [matplotlib-devel] Possible bug in matplotlib.cbook.CallbackRegistry

2011-10-25 Thread Tobin H. Van Pelt
Daniel - Yes that works. In my case - I hate to edit any existing third party code bases - or it bites me later when I upgrade. For now - I simply do my own dead reference clean up externally when doing the deletes. Really, that would be the same as just doing a disconnect - but for othe

Re: [matplotlib-devel] Possible bug in matplotlib.cbook.CallbackRegistry

2011-10-25 Thread Daniel Hyams
I've run into this same issue in the past, and have it "fixed" in my own local copy of matplotlib. I just placed a check to make sure that cid actually was in the callbacks for s before deleting it. That is quite possibly a band-aid; I never looked far enough in to see. But it is possibly anothe

Re: [matplotlib-devel] Possible bug in matplotlib.cbook.CallbackRegistry

2011-10-25 Thread tobin
Here is a bit more detail and a simple example. The example below places red squares in an axes. When the user clicks on an existing red square - another square is created and added. When the user hits any key a square is deleted from the axes. The error is triggered by clicking on the red sq

Re: [matplotlib-devel] Possible bug in matplotlib.cbook.CallbackRegistry

2011-10-17 Thread Michael Droettboom
Another common solution to this problem is to copy the list of callbacks before iterating over it. Having a simple example would be helpful here so we can experiment with these alternate approaches. Mike On 10/16/2011 09:04 PM, to...@i3dtech.com wrote: > Within matplotlib.cbook.CallbackRegistr

[matplotlib-devel] Possible bug in matplotlib.cbook.CallbackRegistry

2011-10-17 Thread tobin
Within matplotlib.cbook.CallbackRegistry both the connect() and process() methods check for dead references when called. If a reference is dead it deletes it from the callback list. I have found a situation where this presents a problem. First, a "button_press_event" calls the process method()