Skip to content

fix: dispose owned scroll controllers and floating-cursor timer - #119

Open
SebTardif wants to merge 1 commit into
reqable:mainfrom
SebTardif:fix/floating-cursor-timer-dispose
Open

fix: dispose owned scroll controllers and floating-cursor timer#119
SebTardif wants to merge 1 commit into
reqable:mainfrom
SebTardif:fix/floating-cursor-timer-dispose

Conversation

@SebTardif

Copy link
Copy Markdown
Contributor

Summary

Two resource-lifetime fixes in the editor:

  1. CodeScrollController allocated default ScrollControllers when the caller omitted them, but dispose() only cleared the editor key, leaking two controllers per default editor instance. Track ownership and dispose only controllers we create.
  2. Floating-cursor edge autoscroll uses a periodic Timer that was cancelled on gesture end, but not in dispose(), so disposing the input controller mid-drag could leave a live timer on a detached object.

Testing

  • Verified dispose paths cancel _floatingCursorScrollTimer and dispose owned scroll controllers only
  • Existing gesture cancel paths unchanged

Closes resource-leak audit items F001 and F005.

CodeScrollController allocated default ScrollControllers but dispose()
only cleared the editor key, leaking two controllers per default
editor. Track ownership and dispose only controllers we create.

Also cancel _floatingCursorScrollTimer in _CodeInputController.dispose
so disposing mid-edge-drag cannot leave a periodic timer on a detached
controller.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant