I have a wxPython App that when it exits launches a diff python App
which segfaults on *nix.
I have narrowed the issue down to loading wx.media.MediaCtrl in the
second app which I find strange because if I launch that app by itself
(not via the 1st app) it runs fine. I have made a small demo that
shows the error
How to replicate
launch example.py then close the frame. What should happen is a second
frame comes up, but it segfaults
Try launching example1.py to see that the app does indeed work if
launched on it's own
------------------------------------------------------------------------
import wxversion
wxversion.select(["2.8"])
import wx
class BlankFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="App Launch error example")
self.Freeze()
sizer = wx.BoxSizer(wx.VERTICAL)
self.textctrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE)
sizer.Add(self.textctrl, 1, wx.EXPAND)
self.textctrl.SetValue("This is App 1")
self.SetSizer(sizer)
self.SetAutoLayout(True)
self.Layout()
self.Thaw()
class BlankApp(wx.App):
def OnInit(self):
self.frame = BlankFrame()
self.frame.Show()
self.SetTopWindow(self.frame)
return True
def OnExit(self):
import example1
app = example1.BlankApp(0)
app.MainLoop()
if __name__ == "__main__":
app = BlankApp(0)
app.MainLoop()
------------------------------------------------------------------------
import wxversion
wxversion.select(["2.8"])
import wx
import wx.media
class BlankFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="App Launch error example")
self.Freeze()
sizer = wx.BoxSizer(wx.VERTICAL)
self.textctrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_MULTILINE)
sizer.Add(self.textctrl, 1, wx.EXPAND)
self.textctrl.SetValue("This is App 2")
#This Segfaults on *nix if loaded via example.py but not if loaded on it's own
try:
self.mc = wx.media.MediaCtrl(self, style=wx.SIMPLE_BORDER)
self.mc.Hide()
except Exception, e:
print e
self.SetSizer(sizer)
self.SetAutoLayout(True)
self.Layout()
self.Thaw()
class BlankApp(wx.App):
def OnInit(self):
self.frame = BlankFrame()
self.frame.Show()
self.SetTopWindow(self.frame)
return True
if __name__ == "__main__":
app = BlankApp(0)
app.MainLoop()
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org