fix quitting when a transaction is running

This commit is contained in:
guinux 2016-05-05 13:16:38 +02:00
parent 24090fafce
commit 95b3e901fb

View File

@ -132,8 +132,8 @@ namespace Pamac {
},
// only one thread created so alpm action will run one after one
1,
// exclusive thread
true
// no exclusive thread
false
);
} catch (ThreadError e) {
stderr.printf ("Thread Error %s\n", e.message);
@ -1613,13 +1613,12 @@ namespace Pamac {
[DBus (no_reply = true)]
public void quit () {
// to be sure to not quit with locked databases,
// the above function will wait for all task in queue
// to be processed before return;
ThreadPool.free ((owned) thread_pool, false, true);
// be sure to not quit with locked databases
if (thread_pool.get_num_threads () == 0) {
alpm_handle.unlock ();
loop.quit ();
}
}
// End of Daemon Object
}
}