mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove "Not delivered events in the queue" assertion causing troubles hard to get rid of (IDEA-198778)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
package com.intellij.util.messages;
|
||||
|
||||
import com.intellij.openapi.Disposable;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
@@ -365,4 +366,13 @@ public class MessageBusTest extends TestCase {
|
||||
myBus.syncPublisher(TOPIC1).t11();
|
||||
assertEvents("root 11", "child 11", "root 12", "child 12");
|
||||
}
|
||||
|
||||
public void testTwoHandlersBothDisconnecting() {
|
||||
Disposable disposable = Disposer.newDisposable();
|
||||
for (int i = 0; i < 2; i++) {
|
||||
myBus.connect(disposable).subscribe(RUNNABLE_TOPIC, () -> Disposer.dispose(disposable));
|
||||
}
|
||||
myBus.syncPublisher(RUNNABLE_TOPIC).run();
|
||||
assertTrue(Disposer.isDisposed(disposable));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,12 +79,9 @@ public class MessageBusConnectionImpl implements MessageBusConnection {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
Queue<Message> jobs = myPendingMessages.get();
|
||||
myPendingMessages.get();
|
||||
myPendingMessages.remove();
|
||||
myBus.notifyConnectionTerminated(this);
|
||||
if (!jobs.isEmpty()) {
|
||||
LOG.error("Not delivered events in the queue: " + jobs);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user