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:
Vadim Zeitlin 2020-07-11 19:33:35 +02:00
parent 5495389db5
commit 6f7dc14801

View File

@ -323,7 +323,7 @@ void wxInfoBar::RemoveButton(wxWindowID btnid)
if (i->id == btnid)
{
gtk_widget_destroy(i->button);
buttons.erase(i.base());
buttons.erase(i.base() - 1);
// see comment in GTKAddButton()
InvalidateBestSize();