9338207018
This gets rid of the smell that one destroyIfLastRef() call guarded against nullptr while the other one did not. Don't change the function signatures, as passing by unique_ptr, while making the transfer of ownership clear, makes it impossible to call the function as a tail-call: Non-trivially-copyable arguments live in the caller's stack frame and the caller has no idea whether the object was moved from in the callee or not, so it needs to run the dtor, which prevents this from being tail-callable. Passing .release(), OTOH, makes it obvious that the unique_ptr is nullptr afterwards, so leaves the door open for tail-calling. However, the QObjectPrivate::connectImpl() wasn't, and continues to not be, a tail-call. Investigating why, while intriguing, is for another patch (and much more important for the template wrappers of these functions than then one out-of-line function we're dealing with here). Pick-to: 6.6 6.5 Change-Id: Ib951ed2a2b622d70cb12ddbf01c83ec56b1ce70d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |