Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid creating multiple clients per project #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bddavis
Copy link

@bddavis bddavis commented Sep 28, 2024

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

@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

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