ChangesViewToolWindowPanel () { if (myToolWindowPanel == null) { Activity activity = StartUpMeasurer.startActivity("ChangesViewToolWindowPanel initialization"); // ChangesViewPanel is used for a singular ChangesViewToolWindowPanel instance. Cleanup is not needed. ChangesViewPanel changesViewPanel = initChangesPanel(); ChangesViewToolWindowPanel panel = new ChangesViewToolWindowPanel(myProject, this, changesViewPanel); Disposer.register(this, panel); panel.updateCommitWorkflow(); myToolWindowPanel = panel; Disposer.register(panel, () -> { // Content is removed from TW myChangesPanel = null; myToolWindowPanel = null; }); activity.end(); } return myToolWindowPanel; }