fix quitting when a transaction is running
This commit is contained in:
parent
24090fafce
commit
95b3e901fb
@ -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,13 +1613,12 @@ 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;
|
|
||||||
ThreadPool.free ((owned) thread_pool, false, true);
|
|
||||||
alpm_handle.unlock ();
|
alpm_handle.unlock ();
|
||||||
loop.quit ();
|
loop.quit ();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// End of Daemon Object
|
// End of Daemon Object
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user