Alex DeCaria
2010-Apr-03 12:38 UTC
[fxruby-users] FXlistBox.fillItems() segmentation fault - Found Work-around
As my prior posts show, I was getting very random segmentation faults when repeatedly clearing items from a listbox and then repopulating the items. I was using the following statements: mylistbox.clearItems() mylistbox.fillItems(new_list) This would work for awhile, but after enough iterations of clearing and replacing the items in the listbox it would segmentation faults at the .fillItems call. I found a workaround. If instead, I do: mylistbox.clearItems() new_list.each { |item| mylistbox.appendItem(item) } the app works fine and never gives a segmentation fault. I don''t know why the latter is stable, while the former is not, but at least I found a working solution. I thought I''d post this in case someone else runs into this problem in the future. --Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20100403/eb1317b3/attachment.html>