GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Refactor TextEditor instance/context parallel arrays · Issue #74 · scijava/script-editor

Refactor TextEditor instance/context parallel arrays  #74

New issue
Copy link
New issue
Copy link
Open
Open
Refactor TextEditor instance/context parallel arrays #74
Copy link

Description

@hinerm
hinerm
opened on Nov 24, 2025
Issue body actions

There are static ArrayLists of TextEditor instances.. and a parallel contexts ArrayList (should be List if anything). These lists are only added to. When an editor is closed it is not disposed but stays in its list.

The editor should just be disposed when it closes unless we only want one open at a time, in which case we should just keep one instance that shows/hides as needed.

Activity

  1. hinerm
    changed the title [-]TextEditor instance/context parallel arrays need to not be a thing[/-] [+]Refactor TextEditor instance/context parallel arrays [/+] on Nov 24, 2025
  2. ctrueden commented on Nov 24, 2025

    @ctrueden
    ctrueden
    on Nov 24, 2025
    Member
    More actions

    I fear we will find many such problems, which is why I suggested we should perhaps vibe code something new. Might be faster and cleaner than trying to fix what's currently here incrementally...

  3. hinerm commented on Nov 24, 2025

    @hinerm
    hinerm
    on Nov 24, 2025
    MemberAuthor
    More actions

    My concern with a total rebuild is the time it would take and pain of rediscovering issues that worked before. A lot of things seem to work acceptably. Even the instances thing isn't causing problems, it's just not an ideal design.

    Alternatively we could also do a vibe refactoring/code analysis to find the smelliest sub-systems, instead of starting from scratch.

  4. acardona commented on Dec 2, 2025

    @acardona
    acardona
    on Dec 2, 2025
    Collaborator
    More actions

    Hi Mark,
    Thanks for spotting this bug – I did notice that memory wasn't being released, which lead to many restarts of Fiji to avoid this after running large jobs that return handles to huge images with full caches.
    A "vibe" refactoring sounds like a horrible idea, in my opinion. Instead, if you haven't yet, I'll look into the ArrayList with dangling interpreter instances.

  5. acardona commented on Dec 2, 2025

    @acardona
    acardona
    on Dec 2, 2025
    Collaborator
    More actions

    To fix that memory leak, I think all that's needed is to remove the instance from both lists at like 745 of the TextEditor class:
    https://github.com/scijava/script-editor/blob/master/src/main/java/org/scijava/ui/swing/script/TextEditor.java#L745

  6. acardona commented on Dec 2, 2025

    @acardona
    acardona
    on Dec 2, 2025
    Collaborator
    More actions

    Or not – I am confusing the tab with the whole script editor window. In that case has to be removed upon closing the TextEditor window.

    Reacted by Mark Hiner-Weir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.