Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
None
Description
When going from string-based connect to PMF connect, there is a gotcha - the PMF-based connection stays valid all the way until QObject's destructor. For the string-based connect it inadvertently leaned on virtual calls no longer resolving to the most-derived type as it was being destructed, so the slots could no longer be found.
What this means is that that a blind port is not possible, since any call during destruction which could lead to a signal emission somewhere might lead back to a partially-destructed derived type's PMF-connected slot.
This task covers looking into ways to work around/fix this.
As a BC option we may be able to use a RAII type marked [[no_unique_address]] that takes care of disconnecting all slots on its current derived "level". Though it would be C++20 only.