diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-14 00:06:05 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-02-14 00:06:05 +0100 |
commit | 66199a99dca9a1be6fcd522613c8a4175951f11d (patch) | |
tree | 861572d7d1a6ffdb100a02abdceb120f20eb48e6 | |
parent | 043353652fea1c55fa412a76c94bd265cee05b1f (diff) | |
download | sink-66199a99dca9a1be6fcd522613c8a4175951f11d.tar.gz sink-66199a99dca9a1be6fcd522613c8a4175951f11d.zip |
Avoid crashing if we get too many notifications.
If notifications come in faster than we can process them we'd run into
the assert.
-rw-r--r-- | common/queryrunner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/queryrunner.cpp b/common/queryrunner.cpp index 40880eb..1b142c8 100644 --- a/common/queryrunner.cpp +++ b/common/queryrunner.cpp | |||
@@ -120,6 +120,10 @@ QueryRunner<DomainType>::QueryRunner(const Sink::Query &query, const Sink::Resou | |||
120 | fetcher({}); | 120 | fetcher({}); |
121 | return KAsync::null(); | 121 | return KAsync::null(); |
122 | } | 122 | } |
123 | if (mQueryInProgress) { | ||
124 | //Can happen if the revision come in quicker than we process them. | ||
125 | return KAsync::null(); | ||
126 | } | ||
123 | Q_ASSERT(!mQueryInProgress); | 127 | Q_ASSERT(!mQueryInProgress); |
124 | return KAsync::syncStart<void>([&] { | 128 | return KAsync::syncStart<void>([&] { |
125 | mQueryInProgress = true; | 129 | mQueryInProgress = true; |