Skip to content

Commit

Permalink
fix shutdown concurrent modification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Mar 12, 2024
1 parent e91a133 commit 97a3413
Showing 1 changed file with 7 additions and 29 deletions.
36 changes: 7 additions & 29 deletions java/org/cef/CefClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,22 @@

package org.cef;

import org.cef.browser.CefBrowser;
import org.cef.browser.CefBrowserFactory;
import org.cef.browser.CefFrame;
import org.cef.browser.CefMessageRouter;
import org.cef.browser.CefRequestContext;
import org.cef.callback.CefAuthCallback;
import org.cef.callback.CefBeforeDownloadCallback;
import org.cef.callback.CefCallback;
import org.cef.callback.CefContextMenuParams;
import org.cef.callback.CefDownloadItem;
import org.cef.callback.CefDownloadItemCallback;
import org.cef.callback.CefDragData;
import org.cef.callback.CefFileDialogCallback;
import org.cef.callback.CefJSDialogCallback;
import org.cef.callback.CefMenuModel;
import org.cef.callback.CefPrintDialogCallback;
import org.cef.callback.CefPrintJobCallback;
import org.cef.browser.*;
import org.cef.callback.*;
import org.cef.handler.*;
import org.cef.misc.BoolRef;
import org.cef.misc.CefAudioParameters;
import org.cef.misc.CefPrintSettings;
import org.cef.misc.StringRef;
import org.cef.network.CefRequest;
import org.cef.network.CefRequest.TransitionType;
import org.cef.network.CefResponse;
import org.cef.network.CefURLRequest;

import java.awt.Dimension;
import java.awt.Point;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import java.awt.*;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Vector;

import javax.swing.SwingUtilities;

/**
* Client that owns a browser and renderer.
*/
Expand Down Expand Up @@ -511,7 +488,8 @@ private void cleanupBrowser(int identifier) {
browser_.remove(identifier);
} else if (!browser_.isEmpty()) {
// Close all browsers.
Collection<CefBrowser> browserList = browser_.values();
Collection<CefBrowser> browserList = new ArrayList<>(browser_.values());

for (CefBrowser browser : browserList) {
browser.close(true);
}
Expand Down

0 comments on commit 97a3413

Please sign in to comment.