Fix wrong iterator in wxInfoBar::RemoveButton() in wxGTK
The iterator passed to erase() was off by 1, but this worked correctly in the default build using wxVector, and not std::vector, because its base() implementation was off by 1 too. Now that wxVector bug is fixed (see the parent) commit, fix the code using it too, which makes it work both in the default and STL builds. Closes #18765.
This commit is contained in:
parent
5495389db5
commit
6f7dc14801
@ -323,7 +323,7 @@ void wxInfoBar::RemoveButton(wxWindowID btnid)
|
|||||||
if (i->id == btnid)
|
if (i->id == btnid)
|
||||||
{
|
{
|
||||||
gtk_widget_destroy(i->button);
|
gtk_widget_destroy(i->button);
|
||||||
buttons.erase(i.base());
|
buttons.erase(i.base() - 1);
|
||||||
|
|
||||||
// see comment in GTKAddButton()
|
// see comment in GTKAddButton()
|
||||||
InvalidateBestSize();
|
InvalidateBestSize();
|
||||||
|
Loading…
Reference in New Issue
Block a user