2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 14:08:41 +00:00

Fix accept/reject lifetime in gtk file dialog

This commit is contained in:
Ilya Fedin
2021-02-05 11:41:12 +04:00
committed by John Preston
parent 36acf60f7e
commit 8fd1d16db6

View File

@@ -110,7 +110,6 @@ private:
rpl::event_stream<> _accept; rpl::event_stream<> _accept;
rpl::event_stream<> _reject; rpl::event_stream<> _reject;
rpl::lifetime _lifetime;
}; };
@@ -208,16 +207,17 @@ void QGtkDialog::exec() {
} else { } else {
// block input to the window, allow input to other GTK dialogs // block input to the window, allow input to other GTK dialogs
QEventLoop loop; QEventLoop loop;
rpl::lifetime lifetime;
accept( accept(
) | rpl::start_with_next([=, &loop] { ) | rpl::start_with_next([&] {
loop.quit(); loop.quit();
}, _lifetime); }, lifetime);
reject( reject(
) | rpl::start_with_next([=, &loop] { ) | rpl::start_with_next([&] {
loop.quit(); loop.quit();
}, _lifetime); }, lifetime);
loop.exec(); loop.exec();
} }