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

Memory leak when the signal is destroyed before the fteng::connection is destroyed #23

Open
Philippe91 opened this issue May 5, 2021 · 1 comment

Comments

@Philippe91
Copy link

If the signal is destroyed after the connected functor, then there is a leak.

Example:

	std::function<void()> stdFunction = [] {};

	auto* testSignal = new fteng::signal<void()>;
	fteng::connection connection = testSignal->connect(std::move(stdFunction));

	delete testSignal;

The leaked object is 'f_type'
allocated from the line:

new (&call.object) unique{ new f_type(std::move(functor)) };

inside connect(F&& functor)

@mikezackles
Copy link

Does #22 fix your problem?

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

2 participants