Skip to content

Commit

Permalink
Fix scheduling deadlock and resource leak
Browse files Browse the repository at this point in the history
  • Loading branch information
basilevs committed Feb 19, 2024
1 parent 3e3da04 commit 6660aad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.List;
import java.util.Set;

import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
Expand Down Expand Up @@ -177,7 +178,7 @@ public void run(IProgressMonitor monitor)
}
}
}
}, monitorArg);
}, project.getProject(), IWorkspace.AVOID_UPDATE, monitorArg);
} catch (CoreException e) {
return e.getStatus();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
Expand Down Expand Up @@ -161,15 +162,18 @@ protected void handleNonemptyList() {

@Override
protected void createButtonsForButtonBar(Composite parent) {
Image image = Images.getImageDescriptor(Images.CONTEXT).createImage();
parent.addDisposeListener(e -> image.dispose());
createButton(parent, NEW_ID,
Messages.ContextSelectionDialog_NewButtonText, false).setImage(
Images.getImageDescriptor(Images.CONTEXT).createImage());
image);

Button captureBtn = createButton(parent, CAPTURE_ID,
Messages.ContextSelectionDialog_CaptureButtonText, false);
captureBtn.setImage(
Images.getImageDescriptor(Images.SNAPSHOT)
.createImage());
Image image2 = Images.getImageDescriptor(Images.SNAPSHOT)
.createImage();
captureBtn.setImage(image2);
parent.addDisposeListener(e -> image2.dispose());
if (type != null) {
captureBtn.setEnabled(type.canCreate());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Element-Type: testcase
Element-Version: 3.0
External-Reference:
Id: _BdPiYI_eEeK23bkAp9HBOg
Runtime-Version: 2.4.0.qualifier
Save-Time: 11/16/18 8:39 PM
Runtime-Version: 2.5.5.202402181135
Save-Time: 2/18/24, 9:48 PM
Tags: Context, DefaultContext
Testcase-Type: ecl

Expand Down Expand Up @@ -45,7 +45,7 @@ with [get-window "Select context"] {
}
get-menu -path "File/Save" | click
with [get-window "Project Context and Verification References"] {
get-button "Always remove default project context and verification references automatically." | check
get-button "Remember my decision" | check
get-button Yes | click
}
get-editor "MyProject - Project Settings" | get-section "Default Contexts" | get-button "Add..." | click
Expand Down

0 comments on commit 6660aad

Please sign in to comment.