mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
diff: abort background computation on new request
Fix issue, when slow async `doLoadRequest` could override recently updated request.
Steps to reproduce:
* Have diff with multiple files and slow `doLoadRequest`
* Wait till request for the first file is loaded
* Switch to the second file ("Loading" request is shown)
* Switch back to the first file (request is taken from cache and shown immediately)
* Wait
* Request for the second file is loaded and replaces active request // BUG
This commit is contained in:
@@ -92,6 +92,7 @@ public abstract class CacheDiffRequestProcessor<T> extends DiffRequestProcessor
|
||||
public void updateRequest(final boolean force, boolean useCache, @Nullable final ScrollToPolicy scrollToChangePolicy) {
|
||||
ApplicationManager.getApplication().assertIsDispatchThread();
|
||||
if (isDisposed()) return;
|
||||
myQueue.abort();
|
||||
|
||||
final T requestProvider = getCurrentRequestProvider();
|
||||
if (requestProvider == null) {
|
||||
|
||||
Reference in New Issue
Block a user