Files
openide/platform/usageView-impl
Sergei Tachenov 10bdb6f46b IJPL-162465 Do not dispose selected usages in Show Usages
When the Show Usages popup is closed, the smart pointers
contained in usage infos are disposed. Then, AFTER the popup
is disposed, we navigate to the selected usage(s). But at that
time it's already disposed, so some functionality may not work,
e.g. WI-79031.

Fix by maintaining a set of usage infos that must not be disposed
in UsageViewImpl. We update this list along with the list of selected
usages. Of course, it's not guaranteed that the selected usages
will be used at all, and therefore they may never be disposed.
That's OK, as according to SmartPointerManager.removePointer,
disposing smart pointers isn't mandatory. And we're talking about
a single pointer in the vast majority of cases here.
And anyway, in the pre-regression implementations,
ALL the selected usages would be copied every time selection
changes, and were never disposed after that. So this fix is still
better than that, and it doesn't rely on slow ops or the broken copy()
implementation.

GitOrigin-RevId: 751c9dc8b99d48874680cddef8b1b62bbc525975
2024-09-18 10:05:02 +00:00
..