Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

wxSmith crash on opening a resource with patch

(1/1)

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:

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

--- End code ---

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


BYO

Navigation

[0] Message Index

Go to full version