runuifun: Only call the function once

This commit is contained in:
Ilari Liusvaara 2013-09-24 12:59:29 +03:00
parent 82440c44bb
commit 01c6855072

View file

@ -143,6 +143,7 @@ namespace
main_window->notify_exit();
} else if(c == UISERV_UIFUN) {
std::list<ui_queue_entry>::iterator i;
ui_queue_entry e;
queue_synchronous_fn_warning = true;
back:
{
@ -150,12 +151,10 @@ back:
if(ui_queue.empty())
goto end;
i = ui_queue.begin();
}
i->fn(i->arg);
{
mutex::holder h(*ui_mutex);
e = *i;
ui_queue.erase(i);
}
e.fn(e.arg);
goto back;
end:
queue_synchronous_fn_warning = false;