fix for memory leak in paste

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Roman Rolinsky 2006-02-14 20:58:11 +00:00
parent 67cbdfc150
commit 1893848ef7
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ import sys
# Global constants
progname = 'XRCed'
version = '0.1.7-0'
version = '0.1.7-1'
# Minimal wxWindows version
MinWxVersion = (2,6,0)
if wxVERSION[:3] < MinWxVersion:

View File

@ -415,7 +415,7 @@ class Frame(wxFrame):
xxx = tree.GetPyData(selected)
wx.TheClipboard.Open()
data = wx.CustomDataObject('XRCED')
data.SetData(cPickle.dumps(xxx.element))
data.SetData(cPickle.dumps(xxx.element.toxml()))
wx.TheClipboard.SetData(data)
wx.TheClipboard.Close()
self.SetStatusText('Copied')
@ -455,10 +455,10 @@ class Frame(wxFrame):
return
wx.TheClipboard.GetData(data)
wx.TheClipboard.Close()
elem = cPickle.loads(data.GetData())
xml = cPickle.loads(data.GetData()) # xml representation of element
elem = minidom.parseString(xml).childNodes[0]
# Tempopary xxx object to test things
xxx = MakeXXXFromDOM(parent, elem)
# Check compatibility
error = False
# Top-level
@ -925,7 +925,7 @@ Homepage: http://xrced.sourceforge.net\
# Update tools
g.tools.UpdateUI()
#undoMan.RegisterUndo(UndoPasteCreate(parentLeaf, parent, newItem, selected))
undoMan.RegisterUndo(UndoPasteCreate(parentLeaf, parent, newItem, selected))
# Update view?
if g.testWin and tree.IsHighlatable(selected):
if conf.autoRefresh: