Skip to content

Commit d9087c5

Browse files
committed
Store Edge instance in Environemnt record sync-ly
This commit stores the edge instance on creation in the webenvironment record synchronously for the sake of the consistency of the record. contributes to #1592
1 parent d9d9bf0 commit d9087c5

File tree

1 file changed

+1
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser

1 file changed

+1
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Edge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ private String getDataDir(Display display) {
568568
@Override
569569
public void create(Composite parent, int style) {
570570
containingEnvironment = createEnvironment();
571+
containingEnvironment.instances().add(this);
571572
long[] ppv = new long[1];
572573
int hr = containingEnvironment.environment().QueryInterface(COM.IID_ICoreWebView2Environment2, ppv);
573574
if (hr == COM.S_OK) environment2 = new ICoreWebView2Environment2(ppv[0]);
@@ -688,7 +689,6 @@ void setupBrowser(int hr, long pv) {
688689
browser.addListener(SWT.Move, this::browserMove);
689690
scheduleMouseMovementHandling();
690691

691-
containingEnvironment.instances().add(this);
692692
// Sometimes when the shell of the browser is opened before the browser is
693693
// initialized, nothing is drawn on the shell. We need browserResize to force
694694
// the shell to draw itself again.

0 commit comments

Comments
 (0)