Apparently, erase() would make the iterator invalid so we need grab
the next one to have the work correctly.
Bug-AGL: SPEC-5077
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I290fa1231eb6b37ab63c5f5c0bd8fe90d4363a77
(void) id;
for (std::list<global_data>::iterator it = sh->globals.begin();
- it != sh->globals.end(); it++) {
- sh->globals.erase(it);
- }
+ it != sh->globals.end(); it = sh->globals.erase(it))
+ ;
}
static const struct wl_registry_listener registry_listener = {
destroy_output(w_output);
for (std::list<global_data>::iterator it = sh->globals.begin();
- it != sh->globals.end(); it++) {
- sh->globals.erase(it);
- }
+ it != sh->globals.end(); it = sh->globals.erase(it))
+ ;
wl_display_flush(sh->wl_display);
wl_display_disconnect(sh->wl_display);