PyUserInput icon indicating copy to clipboard operation
PyUserInput copied to clipboard

wxPython - Segmentation Fault on exit

Open vanguard93 opened this issue 11 years ago • 3 comments

When used with wxPython, simply adding the line:

"from pymouse import PyMouse"

causes a segmentation fault when the application is exited.

vanguard93 avatar Apr 02 '14 01:04 vanguard93

Could you provide a small self-contained example? or perhaps instructions on how to recreate it?

SavinaRoja avatar Apr 02 '14 21:04 SavinaRoja

Sure. In this example, if you remove the pymouse import line, it will exit cleanly. If you keep the import line, it will segfault on exit:

import wx
from pymouse import PyMouse

class MainFrame(wx.Frame):
    """Class MainFrame."""
    def __init__(self, parent, id):
        """Create the MainFrame."""
        wx.Frame.__init__(self, parent, id, 'Example GUI')


class MainApp(wx.App):
    """Class Main App."""
    def OnInit(self):
        """Init Main App."""
        self.frame = MainFrame(None, -1)
        self.frame.Show(True)
        self.SetTopWindow(self.frame)
        return True

if __name__ == '__main__':
    app = MainApp(0)
    app.MainLoop()

vanguard93 avatar Apr 03 '14 03:04 vanguard93

I just install wxpython v.2.8.12.1 on Ubuntu and conducted the test with the above example app code. I was unable to replicate the issue. What platform are you on?

SavinaRoja avatar Apr 07 '14 18:04 SavinaRoja