mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2026-01-08 17:41:41 +01:00
JBR-2159 Native crash in thread AWT-EventQueue-0 when trying to push commit
(cherry picked from commitbba297b4a4) (cherry picked from commit38b9cf19c0)
This commit is contained in:
committed by
Vitaly Provodin
parent
f8614f0155
commit
c99f7a69f6
@@ -159,7 +159,20 @@ public class AWTThreading {
|
||||
instance.invocations.push(new TrackingQueue());
|
||||
}
|
||||
final TrackingQueue queue = instance.invocations.peek();
|
||||
InvocationEvent event = new InvocationEvent(source, runnable, listener, catchThrowables) {
|
||||
Runnable safeListener = listener;
|
||||
if (listener != null) {
|
||||
// guarantees a single run of the passed 'listener'
|
||||
safeListener = new Runnable() {
|
||||
Runnable origListener = listener;
|
||||
@Override
|
||||
public void run() {
|
||||
if (origListener != null) origListener.run();
|
||||
origListener = null;
|
||||
}
|
||||
};
|
||||
}
|
||||
// guarantees a single dispatch of the event
|
||||
InvocationEvent event = new InvocationEvent(source, runnable, safeListener, catchThrowables) {
|
||||
final SoftReference<TrackingQueue> queueRef = new SoftReference<>(queue);
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user