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

A memory leak point on Orch when addExecutor #3372

Open
Pterosaur opened this issue Nov 15, 2024 · 1 comment
Open

A memory leak point on Orch when addExecutor #3372

Pterosaur opened this issue Nov 15, 2024 · 1 comment

Comments

@Pterosaur
Copy link
Contributor

An executor was added into the m_comsumerMap, but this executor's pointer will not be released in the destructor of Orch. The lifetime of executor is ambiguous.

Orch::addExecutor(new Consumer(new SubscriberStateTable(stateDb, STATE_TRANSCEIVER_INFO_TABLE_NAME, TableConsumable::DEFAULT_POP_BATCH_SIZE, 0), this, STATE_TRANSCEIVER_INFO_TABLE_NAME));

void Orch::addExecutor(Executor* executor)
{
auto inserted = m_consumerMap.emplace(std::piecewise_construct,
std::forward_as_tuple(executor->getName()),
std::forward_as_tuple(executor));

virtual ~Orch() = default;

@Pterosaur
Copy link
Contributor Author

Maybe to use a shared pointer to manage the executor is better.

@Pterosaur Pterosaur changed the title A memory leak point on Orch A memory leak point on Orch when addExecutor Nov 15, 2024
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

No branches or pull requests

1 participant