Skip to content

Commit

Permalink
remove unreferenced tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mino260806 committed Aug 6, 2024
1 parent 6ca79d4 commit ec237c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jadx-gui/src/main/java/jadx/gui/ui/tab/TabsController.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ private void setTabBookmarkedInternal(TabBlueprint blueprint, boolean bookmarked
if (blueprint.isBookmarked() != bookmarked) {
blueprint.setBookmarked(bookmarked);
listeners.forEach(l -> l.onTabBookmarkChange(blueprint));
removeTabIfNotReferenced(blueprint);
}
}

Expand All @@ -150,6 +151,12 @@ private void setTabHiddenInternal(TabBlueprint blueprint, boolean hidden) {
}
}

private void removeTabIfNotReferenced(TabBlueprint blueprint) {
if (blueprint.isHidden() && !blueprint.isReferenced()) {
tabsMap.remove(blueprint.getNode());
}
}

public void closeAllTabs() {
closeAllTabs(false);
}
Expand Down

0 comments on commit ec237c3

Please # to comment.