gui: Fix erasing elements from list during iteration.
gui: Fix erasing elements from list during iteration.

Fixes issue #357.

tuanthng/apitrace,tuanthng/apitrace,EoD/apitrace,joshua5201/apitrace,joshua5201/apitrace,schulmar/apitrace,tuanthng/apitrace,tuanthng/apitrace,apitrace/apitrace,apitrace/apitrace,tuanthng/apitrace,trtt/apitrace,EoD/apitrace,trtt/apitrace,EoD/apitrace,schulmar/apitrace,joshua5201/apitrace,EoD/apitrace,swq0553/apitrace,swq0553/apitrace,trtt/apitrace,swq0553/apitrace,swq0553/apitrace,swq0553/apitrace,schulmar/apitrace,joshua5201/apitrace,trtt/apitrace,apitrace/apitrace,schulmar/apitrace,joshua5201/apitrace,trtt/apitrace,EoD/apitrace,schulmar/apitrace,apitrace/apitrace