reapack

Package manager for REAPER
Log | Files | Refs | Submodules | README | LICENSE

commit 922dfc801820fe0564a9aa623330e1e421d6386b
parent 3c49276c4d3e7b319d0536931b536a3d5f7b43ea
Author: cfillion <cfillion@users.noreply.github.com>
Date:   Tue,  7 Feb 2017 21:32:56 -0500

transaction: do not start the next batch of tasks when cancelled

Diffstat:
Msrc/transaction.cpp | 22++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

diff --git a/src/transaction.cpp b/src/transaction.cpp @@ -190,9 +190,12 @@ bool Transaction::runTasks() TaskQueue().swap(m_nextQueue); } - // do nothing if there are running tasks if(!commitTasks()) - return false; + return false; // we're downloading indexes for synchronization + else if(m_isCancelled) { + finish(); + return true; + } if(m_config->install.promptObsolete && !m_obsolete.empty()) { vector<Registry::Entry> selected; @@ -229,7 +232,12 @@ bool Transaction::runTasks() return false; } + // we're done! + m_registry.commit(); + registerQueued(); + finish(); + return true; } @@ -254,16 +262,6 @@ bool Transaction::commitTasks() void Transaction::finish() { - if(!m_isCancelled) { - m_registry.commit(); - registerQueued(); - } - - assert(m_downloadQueue.idle()); - assert(m_nextQueue.empty()); - assert(m_taskQueues.empty()); - assert(m_regQueue.empty()); - m_onFinish(); m_cleanupHandler(); }