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