add timeout to let the time to the daemon to correctly quit after auto refresh

This commit is contained in:
guinux 2016-09-15 11:08:52 +02:00
parent e4b6528b86
commit c7f42208c0
1 changed files with 13 additions and 7 deletions

View File

@ -64,14 +64,20 @@ bool check_pamac_running () {
}
void on_refresh_finished () {
if (!check_pamac_running ()) {
try {
pamac_daemon.quit ();
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
Timeout.add (1000, () => {
if (!check_pamac_running ()) {
try {
pamac_daemon.quit ();
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
}
}
}
loop.quit ();
Timeout.add (100, () => {
loop.quit ();
return false;
});
return false;
});
}
int main () {