Fix using dangling pointer in artprov sample
Don't cast wxString pointer to const char*, this could never work and didn't crash only by some miracle.
This commit is contained in:
@@ -229,7 +229,9 @@ void wxArtBrowserDialog::SetArtClient(const wxArtClient& client)
|
|||||||
m_list->SetItemState(sel, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
|
m_list->SetItemState(sel, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);
|
||||||
|
|
||||||
m_client = client;
|
m_client = client;
|
||||||
SetArtBitmap((const char*)m_list->GetItemData(sel), m_client);
|
|
||||||
|
const wxString *data = (const wxString*)m_list->GetItemData(sel);
|
||||||
|
SetArtBitmap(*data, m_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxArtBrowserDialog::OnSelectItem(wxListEvent &event)
|
void wxArtBrowserDialog::OnSelectItem(wxListEvent &event)
|
||||||
|
|||||||
Reference in New Issue
Block a user