signals
signals copied to clipboard
Memory leak when the signal is destroyed before the fteng::connection is destroyed
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)
Does #22 fix your problem?