Using this code:

@
obj->connect(sender, &Sender::signal, [] {
});

// later
obj->deleteLater();
@

The object will be deleted, but the connection will not be broken, and
the sender can still signal, the lambda will be called, but of course
it will crash. Is this a known limitation of using lambdas?

I know I could remember the connection and call
disconnect(connectionId) in my Objects dtor, but this manual work can
be easily overlooked

Any ideas?

Phil
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to