Destroying canvas

Hello everyone,

I'm building and application which will display a collection of several wxpanels each of which displays a FigureCanvasWxAgg with a particular subplot.
The user is allowed to remove these panels.
However, after a panel is deleted (call wxPanel.Destroy()), and the mouse moves over the now empty space, I get the following exception:
   File "/usr/lib/pymodules/python2.6/matplotlib/backends/", line 1316, in _onMotion
     FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=evt)
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 1244, in motion_notify_event
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 899, in __init__
     LocationEvent.__init__(self, name, canvas, x, y, guiEvent=guiEvent)
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 817, in __init__
   File "/usr/lib/pymodules/python2.6/matplotlib/", line 844, in _update_enter_leave
     last.canvas.callbacks.process('axes_leave_event', last)
   File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/", line 14586, in __getattr__
     raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the FigureCanvasWxAgg object has been deleted, attribute access no longer allowed.

Looks like the deleted canvas is still listening for mouse move events.
How can I prevent this?

Thank you,