Skip to content

Fix: Local variable stored in non-local memory for instanceCoordinator#7107

Merged
vadi2 merged 1 commit intoMudlet:developmentfrom
guhitb:fix-codeql-warning-mInstanceCoordinator
Jan 26, 2024
Merged

Fix: Local variable stored in non-local memory for instanceCoordinator#7107
vadi2 merged 1 commit intoMudlet:developmentfrom
guhitb:fix-codeql-warning-mInstanceCoordinator

Conversation

@guhitb
Copy link
Copy Markdown
Contributor

@guhitb guhitb commented Jan 26, 2024

Brief overview of PR changes/additions

  • Replaced Mudlet::registerInstanceCoordinator with Mudlet::takeOwnershipOfInstanceCoordinator.
  • Used unique_ptr and std::move() to transfer ownership rather than passing a raw pointer of MudletInstanceCoordinator.

Motivation for adding to Mudlet

CodeQL warning
image
#7065 (comment)

Other info (issues closed, discussion etc)

@guhitb guhitb requested a review from a team as a code owner January 26, 2024 00:08
@guhitb guhitb requested a review from a team January 26, 2024 00:08
@add-deployment-links
Copy link
Copy Markdown

add-deployment-links bot commented Jan 26, 2024

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@vadi2 vadi2 merged commit e3e63e7 into Mudlet:development Jan 26, 2024
@vadi2
Copy link
Copy Markdown
Member

vadi2 commented Jan 26, 2024

That fixed it, and the new code is simpler to understand as well. Thanks!

guhitb added a commit to guhitb/Mudlet that referenced this pull request Jan 30, 2024
Mudlet#7107)

<!-- Keep the title short & concise so anyone non-technical can
understand it,
     the title appears in PTB changelogs -->
- Replaced `Mudlet::registerInstanceCoordinator` with
`Mudlet::takeOwnershipOfInstanceCoordinator`.
- Used unique_ptr and std::move() to transfer ownership rather than
passing a raw pointer of `MudletInstanceCoordinator`.

CodeQL warning

![image](https://github.com/Mudlet/Mudlet/assets/147658676/3344899f-d24c-4cd7-8cf7-dfac8d180d53)
Mudlet#7065 (comment)
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