Better cleanup of circular references.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37267 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -288,9 +288,16 @@ class Shape(ShapeEvtHandler):
|
||||
return str(self.__class__).split(".")[-1][:-2]
|
||||
|
||||
def Delete(self):
|
||||
"""
|
||||
Fully disconnect this shape from parents, children, the
|
||||
canvas, etc.
|
||||
"""
|
||||
if self._parent:
|
||||
self._parent.GetChildren().remove(self)
|
||||
|
||||
for child in self.GetChildren():
|
||||
child.Delete()
|
||||
|
||||
self.ClearText()
|
||||
self.ClearRegions()
|
||||
self.ClearAttachments()
|
||||
@@ -3040,7 +3047,7 @@ class ShapeRegion(object):
|
||||
return None
|
||||
if self._penColour=="Invisible":
|
||||
return None
|
||||
self._actualPenObject = wx.ThePenList.FindOrCreatePen(self._penColour, 1, self._penStyle)
|
||||
self._actualPenObject = wx.Pen(self._penColour, 1, self._penStyle)
|
||||
return self._actualPenObject
|
||||
|
||||
def SetText(self, s):
|
||||
|
Reference in New Issue
Block a user