![]() |
More Mac Issues - wxPython
Has Anyone Tried wxPython For Max OSX?
I'm running Python 2.5 on Mac OSX 10.3.9. I downloaded wxPython 2.8 - OSX - Unicode - 2.8.6.1 - Universal - Python 2.5.When I run it, everything works fine. I can do lots of things like disable/enable widgets, select from a combo box, hide the window, select from the file menu, etc, etc... However, when I try this code, I get a "Segmentation Fault" or "Bus Error". This does not happen on Windows. Any idea what's going on? :
def findBallot(self, event):"findBallot" is called when a letter is typed. It toggles a search list if the entry is incorrect. "destroySearch" destroys this search list once the entry is correct, or an item has been selected. "selectSearch" is called when the user selects one of the search options. The error happens after "selectSearch" is done. This makes little sense, because after "selectSearch" is done, no code is executed. The window remains idle, as a solitary cron task continues running every second afterwards. This task has always been executing, so this shouldn't be an issue. Nevertheless, the code is: :
def handleGlitch(self, event):But "self.checkBallotEntry(None)" can't be the problem either, because it was succesfully called near the end of "selectSearch", which finished executing before the error occurred. I can't show you any more code then this. I actually signed a non-disclosure agreement that stops me from even giving that much away... but whatever... Edit : Probably important to note. I can still see the search list before the program stalls and crashes. This means it did not destroy the search list when it was supposed to. I think this is a good indicator of the error. What am I doing then that Mac OSX doesn't like? It was fine hiding/enabling other widgets. Maybe I'll look at the "destroy" attribute under Mac OSX. Do some testing there... |
Re: More Mac Issues - wxPython
I don't know anything about the Mac, but I'll make a couple of observations. Generally, a segmentation fault means that memory has been accessed when it is not valid to access that area of memory, for whatever reason.
A bus fault indicates that memory was accessed that can't be accessed. Usually, this is because the physical implementation of the memory is such that it can't be addressed on any given byte boundary, but must be accessed on, for example, 4-byte boundaries. Maybe that will give you a clue. It certainly introduces platform dependencies that might result in a bug. |
Re: More Mac Issues - wxPython
This problem is starting to look more defined now. Thanks.
I'm thinking it doesn't like me switching "self.searchResults" back and forth between a wxWidget listbox and a "None" type object, and then finally destroying it. It's most likely having memory allocation trouble with that. I will tweak the implementation, and see if that helps. |
Re: More Mac Issues - wxPython
Yes! It works. Thanks, that was the exact issue. I made it create the listbox once, and toggle it on/off instead. It's actually better this way. Come to think of it, it's quite stupid to keep destroying/initiating the widget, especially when there's no good reason to... An obvious memory hazard.
Adios. |
| All times are GMT -5. The time now is 3:24 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC