Hi,
On Ubuntu, wxPython 2.8.10.1, both with the agw.aui included in
wxPython 2.8.10.1 as well as with the latest version from svn I can
trigger a segfault as follows: start the AUI.py demo and drag the left
tree pane onto the bottom text pane, causing a tab container to occur
with both panes in it. Drag one of the tabs out: boom! segfault.
Inserting some print statements shows that line 6450 is triggering the
segfault:
def OnTabBeginDrag(self, event):
...
if self._masterManager:
self._masterManager.OnTabBeginDrag(event)
else:
paneInfo = self.PaneFromTabEvent(event)
if paneInfo.IsOk():
# It's one of ours!
self._action = actionDragFloatingPane
mouse = wx.GetMousePosition()
# set initial float position - may have to think about this
# offset a bit more later ...
self._action_offset = wx.Point(20, 10)
paneInfo.floating_pos = mouse - self._action_offset
paneInfo.dock_pos = AUI_DOCK_NONE
paneInfo.notebook_id = -1
tab = event.GetEventObject()
# float the window
if paneInfo.IsMaximized():
self.RestorePane(paneInfo)
paneInfo.Float()
self.Update()
self._action_window = paneInfo.window
if wx.Window.GetCapture() == tab: # <------ segfault
tab.ReleaseMouse()
When I slightly change line 6450 code to read:
if tab.HasCapture():
tab.ReleaseMouse()
I receive this traceback:
Traceback (most recent call last):
File "/home/frank/wxPythonDemo/wxPython-2.8.10.1/demo/agw/aui/framemanager.py",
line 6422, in OnTabBeginDrag
self._masterManager.OnTabBeginDrag(event)
File "/home/frank/wxPythonDemo/wxPython-2.8.10.1/demo/agw/aui/framemanager.py",
line 6450, in OnTabBeginDrag
if tab.HasCapture():
File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line 14564, in __getattr__
raise PyDeadObjectError(self.attrStr % self._name)
wx._core.PyDeadObjectError: The C++ part of the AuiTabCtrl object has
been deleted, attribute access no longer allowed.
So apparently the tab has already been destroyed before this code has
a chance to release the tab's mouse capture. I'm not sure how to fix
that.
Cheers, Frank