Author Topic: wxSmith crash on opening a resource with patch  (Read 4675 times)

Offline mike__t

  • Multiple posting newcomer
  • *
  • Posts: 11
wxSmith crash on opening a resource with patch
« on: October 31, 2007, 05:54:48 pm »
Seen on SVN version 4582 on Ubuntu Gutsy, wxGTK-2.8.6

Not sure why this problem wasn't visible before, but it was crashing when setting about the color property editor for the property sheet editor--it seemed to be wandering of the end of the array of wxsColourLabels looking for a NULL while enumerating them.

This patch fixed this crash for me:
Code
--- wxwidgets/properties/wxscolourproperty.cpp  (revision 4582)
+++ wxwidgets/properties/wxscolourproperty.cpp  (working copy)
@@ -90,10 +90,11 @@
         _("Gradient of active caption"),
         _("Gradnent of inactive caption"),
         _("Selected menu item"),
-        _("Menu bar")
+        _("Menu bar"),
+        NULL
     };

-    static const int wxsColourCount = sizeof(wxsColourLabels) / sizeof(wxsColourLabels[0]);
+    static const int wxsColourCount = sizeof(wxsColourLabels) / sizeof(wxsColourLabels[0]) - 1;

     static long wxsColourValues[] = {
         wxsCOLOUR_DEFAULT,

Offline byo

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 837
Re: wxSmith crash on opening a resource with patch
« Reply #1 on: October 31, 2007, 08:22:48 pm »
Thanks for the info. I have never had such crash but that was probably only a big good luck ;)


BYO