Community
Participate
Working Groups
RATs may continue to get triggered after disposing the context We faced this issue in our RCP application when user drags an editor to another window and then closes the first window. The root cause is that listeners added by EclipseContext#trackAccess may stay forever in child contexts. I was able to find out a minimal reproducible snippet: IEclipseContext root = EclipseContextFactory.create("root"); IEclipseContext oldParent = root.createChild("oldParent"); IEclipseContext newParent = root.createChild("newParent"); IEclipseContext leaf = oldParent.createChild("leaf"); oldParent.runAndTrack(new RunAndTrack() { @Override public boolean changed(IEclipseContext context) { IEclipseContext activeLeaf = context.getActiveLeaf(); System.err.println("oldParent's active leaf = " + activeLeaf); return true; } }); leaf.activateBranch(); leaf.setParent(newParent); oldParent.dispose(); System.err.println("oldParent is disposed now !!"); leaf.activateBranch(); // <---- THIS CALL TRIGGERS RAT IN DISPOSED oldParent Wrapping the RAT code into RunAndTrack.runExternalCode fixes this snippet, but in our app RAT WorkbenchWindow.setup() is being triggered (WorkbenchWindow.java:724) RunAndTrack menuChangeManager = new RunAndTrack() { @Override public boolean changed(IEclipseContext context) { ExpressionInfo info = new ExpressionInfo(); IEclipseContext leafContext = windowContext.getActiveLeaf(); . . .
Is this a regression in 4.12?
Reproducible also on 4.6, so not a 4.12 regression
(In reply to Oleksandr Zakusylo from comment #2) > Reproducible also on 4.6, so not a 4.12 regression Thanks. If you want this fixed, providing a patch is the best way. https://wiki.eclipse.org/Platform/How_to_Contribute
New Gerrit change created: https://git.eclipse.org/r/146981
Oleksandr, could you describe how I can reproduce the issue?
Lars, run the piece of code from the bug description. Expected result: "oldParent is disposed now !!" should be the last visible line in console. Actual result: "oldParent's active leaf = ...." appears in console AFTER "oldParent is disposed now !!"
(In reply to Alexander Zakusylo from comment #6) > Lars, run the piece of code from the bug description. > Expected result: "oldParent is disposed now !!" should be the last visible > line in console. > Actual result: "oldParent's active leaf = ...." appears in console AFTER > "oldParent is disposed now !!" I don't dare to touch that code so close to the end of the release cycle. I will try to review very early 4.17. Please ping me early 4.17, in case I do not act proactively. If someone else is more daring, please review and move it back to 4.16.
Mass change to 4.19 M1, please update the target if you have other plans.
Mass move 4.19 M1 bugs to M3
Created attachment 285219 [details] stacktrace I also have issues with this. Specifically, when a new window is created and the other is closed, there are issues. I can work with you on this. Is this stacktrace also what you are seeing?
Mass Move out of 4.20
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.runtime/+/186122