News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

wxSmith crash on opening a resource with patch

Started by mike__t, October 31, 2007, 05:54:48 PM

Previous topic - Next topic

mike__t

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:

--- 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,

byo

Thanks for the info. I have never had such crash but that was probably only a big good luck ;)


BYO