I had a further look at the issue.
It seems that QQuickPixmapCache calls QQuickImageResponse::cancel() several 
times when the LOK viewer is loaded.

We properly synchronize the threads when we queue/dequeue the task from the 
engine but, if the task is currently being processed, it gets deleted during 
its execution.

We need to ensure that the GUI thread (where RenderEngine lives) and the 
LOImageResponse are in sync when we delete the task.
I guess we'd be better not to give ownership of the task to a class that lives 
in another thread, and let RenderEngine handles its tasks at its best.

We only need to subscribe to the RenderEngine's signals, using a 
Qt::BlockingQueuedConnection.

Roman, I remember that the usage of a blocking connection was okay for you 
before you updated the RenderEngine.
What do you think?
-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/lok-qml-async-imageprovider/+merge/282878
Your team Ubuntu Document Viewer Developers is requested to review the proposed 
merge of 
lp:~verzegnassi-stefano/ubuntu-docviewer-app/lok-qml-async-imageprovider into 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to     : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to