s1s0
2012-06-10 13:29:23 UTC
Hi,
A code which is using wxListCtrl and works happily for years on a number of
platforms is crashing consistently if wx is compiled with --enagle-stl
option. The same code works fine if wx is compiled without the option above.
I come across the problem recently when I compiled my code on latest SuSE.
Later I recreated the issue on Fedora with the latest from both 2.8 and 2.9
branches.
The code is using callback for the sorting. Interestingly, the callback
function is called with item IDs which can not be found by FindItem.
Subsequently the wx code crashes.
I'll appreciate some help.
Regards
Svilen
(Example code of the sorting callback function below)
int wxCALLBACK wxListCompareFunction(long item1, long item2, long sortData)
{
wxListItem li1, li2;
long lItem = wxNOT_FOUND;
li1.SetMask(wxLIST_MASK_TEXT);
li1.SetColumn(1);
lItem = CmdList->FindItem(-1, item1);
if (wxNOT_FOUND == lItem)
return -1;
li1.SetId(lItem);
CmdList->GetItem(li1);
li2.SetMask(wxLIST_MASK_TEXT);
li2.SetColumn(1);
lItem = CmdList->FindItem(-1, item2);
if (wxNOT_FOUND == lItem)
return 1;
li2.SetId(lItem);
CmdList->GetItem(li2);
wxString s1 = li1.GetText();
wxString s2 = li2.GetText();
return s1.CompareTo(s2.c_str());
}
A code which is using wxListCtrl and works happily for years on a number of
platforms is crashing consistently if wx is compiled with --enagle-stl
option. The same code works fine if wx is compiled without the option above.
I come across the problem recently when I compiled my code on latest SuSE.
Later I recreated the issue on Fedora with the latest from both 2.8 and 2.9
branches.
The code is using callback for the sorting. Interestingly, the callback
function is called with item IDs which can not be found by FindItem.
Subsequently the wx code crashes.
I'll appreciate some help.
Regards
Svilen
(Example code of the sorting callback function below)
int wxCALLBACK wxListCompareFunction(long item1, long item2, long sortData)
{
wxListItem li1, li2;
long lItem = wxNOT_FOUND;
li1.SetMask(wxLIST_MASK_TEXT);
li1.SetColumn(1);
lItem = CmdList->FindItem(-1, item1);
if (wxNOT_FOUND == lItem)
return -1;
li1.SetId(lItem);
CmdList->GetItem(li1);
li2.SetMask(wxLIST_MASK_TEXT);
li2.SetColumn(1);
lItem = CmdList->FindItem(-1, item2);
if (wxNOT_FOUND == lItem)
return 1;
li2.SetId(lItem);
CmdList->GetItem(li2);
wxString s1 = li1.GetText();
wxString s2 = li2.GetText();
return s1.CompareTo(s2.c_str());
}
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users