| 9 | namespace platform |
| 10 | { |
| 11 | base::TaskLoop::PushResult GuiThread::Push(Task && task) |
| 12 | { |
| 13 | // Following hack is used to post on main message loop |fn| when |
| 14 | // |source| is destroyed (at the exit of the code block). |
| 15 | QObject source; |
| 16 | QObject::connect(&source, &QObject::destroyed, QCoreApplication::instance(), std::move(task)); |
| 17 | |
| 18 | return {true, base::TaskLoop::kNoId}; |
| 19 | } |
| 20 | |
| 21 | base::TaskLoop::PushResult GuiThread::Push(Task const & task) |
| 22 | { |