wxPython with ScriptingBridge causes Seg Fault on exit

96 views Asked by At

This is a very odd situation that I can not seem to figure out. I'm writing an application with wxPython on OSX Lion (wxpython version 2,9,3,1).

Whenever I import from ScriptingBridge and do something as simple as create a frame and then close it, it does not close cleanly and seg faults upon closing. Give this code a try:

from ScriptingBridge import *

import wx

class Test(wx.Frame):
    def __init__(self, parent, title):
        super(Test, self).__init__(parent, title=title, size=(300, 200))
        self.Show()

app = wx.App()
Test(None, 'Hello')
app.MainLoop()

After running this code, just simply close it. It should seg fault. Now, simply comment out the ScriptingBridge import and run it again and close it. No Seg Fault.

What makes this even stranger is that if you just create a script that imports ScriptingBridge and yet does not import wxPython, once the script exits, it will not seg fault... It appears it's a combination between the two.

Has anyone seen this and have they found a work around for it? I'd like my app to exit cleanly if possible.

0

There are 0 answers