Commit dbe9a8c9 authored by Olivier Goffart's avatar Olivier Goffart Committed by Shawn Rutledge
Browse files

Don't copy the functor object for each signal emission


The behavior was different in the variadic template code and in the C++98
code. The code without variadic template support was not copying the functor
object (e.g. a lambda) before calling it.
However, in the variadic template section, QtPrivate::FunctorCall::call
took the functor by value instead of by reference resulting in a copy.

QtPrivate::FunctorCall::call is a helper function for
QtPrivate::FunctionPointer::call which is only needed for variadic template
expension.

[ChangeLog][QtCore][QObject] If the compiler supports variadic templates,
no longer copy functor connected to a signal each time the signal is
emitted. Restoring the C++98 behavior.

Task-number: QTBUG-52542
Change-Id: I3ca20ef6910893b8a288e70af7de4c7b69502173
Reviewed-by: default avatarThiago Macieira <thiago.macieira@intel.com>
parent 3b98467e
Branches
Tags
Showing with 20 additions and 1 deletion
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment