I was curious what is the scope of an object, if I do that.
Code:
void myMethod() { Object o; emit MySignal(o);
If I transfer the object to another thread, what happens to the object scope? o is allocated on stack.
Printable View
I was curious what is the scope of an object, if I do that.
Code:
void myMethod() { Object o; emit MySignal(o);
If I transfer the object to another thread, what happens to the object scope? o is allocated on stack.
The object always goes out of scope when the function returns. The signal carries a copy of the object in case of a cross-thread emission and a copy or a cost or non-const reference in case of a direct call.