mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
JBR-2159 Native crash in thread AWT-EventQueue-0 when trying to push commit
(cherry picked from commit bba297b4a4)
This commit is contained in:
@@ -163,7 +163,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