cjprecord / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

PyDeadObject Errors when closing #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. close the editor while a source control command is running

This happens sometimes when closing the editor. It usually happens when the
editor starts and there are a number of project files that are loaded
automatically from the last session. Sometimes after starting the editor in
this condition the projects plugin commands don't seem to time out properly
(the progress bar runs indefinitely or until a freeze/crash happens) so
when I close the editor when this happens I get this traceback.

*** Sun Sep 16 21:23:50 2007 ***
Traceback (most recent call last):
  File "wx/_core.pyo", line 14095, in <lambda>
  File "build/bdist.macosx-10.3-fat/egg/projects/ProjectPane.py", line 883,
in endSCCommand
  File "wx/_core.pyo", line 14041, in __getattr__
PyDeadObjectError: The C++ part of the ProjectTree object has been deleted,
attribute access no longer allowed.

The cause seems to be in:
    def endSCCommand(self, delayedresult):
        self.GetParent().StopBusy()

which is trying to access the GetParent method of the ProjectTree, which in
this case the CPP part of the tree has already been deleted leading to the
error.

One (easy) fix for this would be to trap the error

def endSCCommand(self, delayedresult):
    try:
        self.GetParent().StopBusy()
    except wx.PyDeadObjectError:
        pass

It would probably be better to start with figuring why the plugin gets
stuck in the busy state when starting sometimes, but the above should fix
the immediate problem at hand.

Original issue reported on code.google.com by CodyPrec...@gmail.com on 17 Sep 2007 at 2:57

GoogleCodeExporter commented 9 years ago
I pushed the easy fix that you mentioned for now

Original comment by Kevin.Da...@gmail.com on 10 Oct 2007 at 3:35

GoogleCodeExporter commented 9 years ago
Closing this as being fixed.

Original comment by CodyPrec...@gmail.com on 4 Jul 2008 at 11:50

GoogleCodeExporter commented 9 years ago
Move old 'fixed' issues to verified

Original comment by CodyPrec...@gmail.com on 3 Feb 2009 at 8:18