Author Topic: crash when I try to open a wxsmith file under C::B against wx 3.3.1  (Read 1989 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6135
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
It looks like the C::B try to read some string values to "reconstruct" the prop grid when reading the wxs file.

But the "string value" maybe empty or not correct, so wx just report the assert.

My guess is that the issue is inside the wxWidgets' library code, not in the C::B's source code.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1817
This method, defined in wxscolourproperty.cpp:152
Code
    wxString wxsMyColourPropertyClass::ValueToString( wxVariant& value,  int argFlags ) const
does not override in wx >= 3.3.0 because the second parameter is no longer an integer, see the documentation.

EDIT: Adding "override" to the declaration would have uncovered this long ago.
« Last Edit: Today at 05:14:10 pm by Miguel Gimenez »

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1817
Try this file (rename as cpp). It may need some adjustment to compile on wx3.3.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 837
Not extensivety tested, but it looks OK : wxs files are opened without crash.
Thanks
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.1, Msys2 Compilers 15.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).