Skip to content

Conversation

@xyOz-dev
Copy link
Contributor

@xyOz-dev xyOz-dev commented Jun 2, 2025

Description

significantly improves resource management by separating webview-specific disposables, preventing memory leaks and allowing for more efficient cleanup and reuse of ClineProvider instances

Type of Change

  • 🐛 Bug Fix: Non-breaking change that fixes an issue.

Important

Improved resource management in ClineProvider by separating webview-specific disposables to prevent memory leaks and enhance cleanup efficiency.

  • Resource Management:
    • Introduced webviewDisposables array in ClineProvider to manage webview-specific disposables separately from general disposables.
    • Added clearWebviewResources() method to dispose of all webview-specific disposables.
    • Updated dispose() method to call clearWebviewResources() for efficient cleanup.
  • Code Changes:
    • Moved codeIndexStatusSubscription and other webview-related disposables to webviewDisposables in resolveWebviewView().
    • Updated event listeners in resolveWebviewView() to use webviewDisposables.
    • Adjusted onDidDispose event to clear webview resources for sidebar views without disposing the entire ClineProvider instance.

This description was created by Ellipsis for d9d40e8. You can customize this summary. It will automatically update as commits are pushed.

@xyOz-dev xyOz-dev requested review from cte and mrubens as code owners June 2, 2025 21:56
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Jun 2, 2025
@xyOz-dev xyOz-dev changed the title Webview leaks ClineProvider Instance cleanup Jun 2, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Prelim Review] in Roo Code Roadmap Jun 3, 2025
@daniel-lxs daniel-lxs moved this from PR [Needs Prelim Review] to PR [Changes Requested] in Roo Code Roadmap Jun 3, 2025
@daniel-lxs
Copy link
Member

daniel-lxs commented Jun 3, 2025

I like this change, we still keep the recent fix of keeping the ClineProvider instance when moving Roo from one sidebar to the other, but the resources of the webview are properly disposed as well.

I tested it and everything seems to work and the resources are disposed correctly.

LGTM

@daniel-lxs daniel-lxs moved this from PR [Changes Requested] to PR [Needs Review] in Roo Code Roadmap Jun 3, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 4, 2025
@mrubens mrubens merged commit c02e01e into RooCodeInc:main Jun 4, 2025
24 checks passed
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Jun 4, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants