jdk/src/share/classes/java/awt/Window.java

Print this page
rev 5693 : 7192977: Issue in toolkit thread
Reviewed-by: skoivu, rupashka, art


1189                 beforeFirstShow = true;
1190                 removeNotify();
1191                 synchronized (inputContextLock) {
1192                     if (inputContext != null) {
1193                         inputContext.dispose();
1194                         inputContext = null;
1195                     }
1196                 }
1197                 clearCurrentFocusCycleRootOnHide();
1198             } finally {
1199                 disposing = false;
1200             }
1201         }
1202     }
1203         DisposeAction action = new DisposeAction();
1204         if (EventQueue.isDispatchThread()) {
1205             action.run();
1206         }
1207         else {
1208             try {
1209                 EventQueue.invokeAndWait(action);
1210             }
1211             catch (InterruptedException e) {
1212                 System.err.println("Disposal was interrupted:");
1213                 e.printStackTrace();
1214             }
1215             catch (InvocationTargetException e) {
1216                 System.err.println("Exception during disposal:");
1217                 e.printStackTrace();
1218             }
1219         }
1220         // Execute outside the Runnable because postWindowEvent is
1221         // synchronized on (this). We don't need to synchronize the call
1222         // on the EventQueue anyways.
1223         postWindowEvent(WindowEvent.WINDOW_CLOSED);
1224     }
1225 
1226     /*
1227      * Should only be called while holding the tree lock.
1228      * It's overridden here because parent == owner in Window,
1229      * and we shouldn't adjust counter on owner




1189                 beforeFirstShow = true;
1190                 removeNotify();
1191                 synchronized (inputContextLock) {
1192                     if (inputContext != null) {
1193                         inputContext.dispose();
1194                         inputContext = null;
1195                     }
1196                 }
1197                 clearCurrentFocusCycleRootOnHide();
1198             } finally {
1199                 disposing = false;
1200             }
1201         }
1202     }
1203         DisposeAction action = new DisposeAction();
1204         if (EventQueue.isDispatchThread()) {
1205             action.run();
1206         }
1207         else {
1208             try {
1209                 EventQueue.invokeAndWait(this, action);
1210             }
1211             catch (InterruptedException e) {
1212                 System.err.println("Disposal was interrupted:");
1213                 e.printStackTrace();
1214             }
1215             catch (InvocationTargetException e) {
1216                 System.err.println("Exception during disposal:");
1217                 e.printStackTrace();
1218             }
1219         }
1220         // Execute outside the Runnable because postWindowEvent is
1221         // synchronized on (this). We don't need to synchronize the call
1222         // on the EventQueue anyways.
1223         postWindowEvent(WindowEvent.WINDOW_CLOSED);
1224     }
1225 
1226     /*
1227      * Should only be called while holding the tree lock.
1228      * It's overridden here because parent == owner in Window,
1229      * and we shouldn't adjust counter on owner