kit/Kit.cpp |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 2d39e461200eae060e0bb7220d21972dd8076ea6
Author:     Michael Meeks <[email protected]>
AuthorDate: Thu Jul 16 19:10:05 2020 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Jul 29 10:18:28 2020 +0200

    Process any pending tileQueue items first.
    
    Change-Id: I078bc1f52ba7647ca1715ea3222d695936dd657f
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98928
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Michael Meeks <[email protected]>
    (cherry picked from commit 0084c3b275bbbad7f3ee2d36f86afc10fbc5400c)
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98956
    Tested-by: Andras Timar <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>

diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 4d20d27b4..09b003efc 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -1928,11 +1928,16 @@ private:
     }
 
 public:
+    bool hasQueueItems() const
+    {
+        return _tileQueue && !_tileQueue->isEmpty();
+    }
+
     void drainQueue(const std::chrono::steady_clock::time_point &/*now*/)
     {
         try
         {
-            while (!_tileQueue->isEmpty())
+            while (hasQueueItems())
             {
                 if (_stop || SigUtil::getTerminationFlag())
                 {
@@ -2201,7 +2206,10 @@ public:
             _pollEnd = std::chrono::steady_clock::now() + 
std::chrono::microseconds(timeoutMicroS);
             do
             {
-                if (poll(timeoutMicroS) <= 0)
+                int realTimeout = timeoutMicroS;
+                if (_document && _document->hasQueueItems())
+                    realTimeout = 0;
+                if (poll(realTimeout) <= 0)
                     break;
 
                 const auto now = std::chrono::steady_clock::now();
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to