stack object Qt signal and parameter as reference
May I have a "dangling reference" with the following code (in an eventual slot connected to the myQtSignal)? class Test : public QObject { Q_OBJECT signals: void myQtSignal(const FooObject& obj); public: void sendSignal(const FooObject& fooStackObject) { emit myQtSignal(fooStackObject); } }; void f() { FooObject fooStackObject; Test t; t.sendSignal(fooStackObject); } int main() { f(); std::cin.ignore(); return 0; } Particularly if emit and slot are not executed in the same thread. HostileFork UPDATE 20-APR-2015 Originally I believed that passing a reference to a stack-allocated object would be