Skip to content

Avoid creating multiple clients per project - #9

Open
bddavis wants to merge 1 commit into
eclipse-cdt-cloud:mainfrom
bddavis:09-27-fix-client-leak
Open

bddavis wants to merge 1 commit into
eclipse-cdt-cloud:mainfrom
bddavis:09-27-fix-client-leak

Conversation

@bddavis

@bddavis bddavis commented Sep 28, 2024

Copy link
Copy Markdown

If a file is opened within a project while a client for that project already exists, we create a new client to replace the old one in the map, without disposing of the old client.

Fixes:

  1. If createClient replaces a client in the map, always dispose of the replaced client to avoid leaking clients.
  2. Remove now redundant calls to disposeClient which are made just before calls to createClient for the same project.
  3. Don't call createClient at all when a document is opened in a project if a client already exists for the given project.

If a file is opened within a project while a client for that
project already exists, we create a new client to replace
the old one in the map, without disposing of the old client.

Fixes:
1. If createClient replaces a client in the map, always dispose
of the replaced client to avoid leaking clients.
2. Remove now redundant calls to disposeClient which are made
just before calls to createClient for the same project.
3. Don't call createClient at all when a document is opened
in a project if a client already exists for the given project.
@tortmayr

Copy link
Copy Markdown

@bddavis Thanks for opening this PR. There was an issue with my watch notifications so I did not receive a trigger for this PR.
I will look into it as soon as possible.

@tortmayr

Copy link
Copy Markdown

Since cdt.cloud is a member of the Eclipse Foundation, all contributors must first sign the Eclipse Contributor Agreement (ECA) before their code changes can be merged into source. The Eclipse Foundation maintains an ECA FAQ with more information about the ECA’s provisions.

To do so you need to have an account on [eclipse.org](Eclipse projects forge)

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.

2 participants