mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
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