mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ui: do not leak disposed Content via layout after toolwindow deactivation
Disposed Content was accessible via myLastLayout.toDrop collection. GitOrigin-RevId: 8dcc2647e374c46848cbfa50b2c92951defc32ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4d255bbce6
commit
3427858d90
@@ -8,7 +8,6 @@ import com.intellij.ide.actions.*
|
||||
import com.intellij.ide.impl.ContentManagerWatcher
|
||||
import com.intellij.idea.ActionsBundle
|
||||
import com.intellij.internal.statistic.eventLog.EventPair
|
||||
import com.intellij.internal.statistic.eventLog.FeatureUsageData
|
||||
import com.intellij.notification.EventLog
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.actionSystem.*
|
||||
@@ -321,6 +320,10 @@ internal class ToolWindowImpl(val toolWindowManager: ToolWindowManagerImpl,
|
||||
if (isAvailable != value) {
|
||||
isAvailable = value
|
||||
toolWindowManager.toolWindowPropertyChanged(this, ToolWindowProperty.AVAILABLE)
|
||||
|
||||
if (!value) {
|
||||
contentUi?.dropCaches()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,10 @@ final class TabContentLayout extends ContentLayout implements MorePopupAware {
|
||||
return myLastLayout.moreRect;
|
||||
}
|
||||
|
||||
public void dropCaches() {
|
||||
myLastLayout = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canShowMorePopup() {
|
||||
return getMoreRect() != null;
|
||||
|
||||
+4
@@ -225,6 +225,10 @@ public final class ToolWindowContentUi implements ContentUI, DataProvider {
|
||||
contentComponent.repaint();
|
||||
}
|
||||
|
||||
public void dropCaches() {
|
||||
tabsLayout.dropCaches();
|
||||
}
|
||||
|
||||
private void rebuild() {
|
||||
getCurrentLayout().rebuild();
|
||||
getCurrentLayout().update();
|
||||
|
||||
Reference in New Issue
Block a user