mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-25 23:13:11 +02:00
Fix accept/reject lifetime in gtk file dialog
This commit is contained in:
parent
36acf60f7e
commit
8fd1d16db6
1 changed files with 5 additions and 5 deletions
|
@ -110,7 +110,6 @@ private:
|
|||
|
||||
rpl::event_stream<> _accept;
|
||||
rpl::event_stream<> _reject;
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
};
|
||||
|
||||
|
@ -208,16 +207,17 @@ void QGtkDialog::exec() {
|
|||
} else {
|
||||
// block input to the window, allow input to other GTK dialogs
|
||||
QEventLoop loop;
|
||||
rpl::lifetime lifetime;
|
||||
|
||||
accept(
|
||||
) | rpl::start_with_next([=, &loop] {
|
||||
) | rpl::start_with_next([&] {
|
||||
loop.quit();
|
||||
}, _lifetime);
|
||||
}, lifetime);
|
||||
|
||||
reject(
|
||||
) | rpl::start_with_next([=, &loop] {
|
||||
) | rpl::start_with_next([&] {
|
||||
loop.quit();
|
||||
}, _lifetime);
|
||||
}, lifetime);
|
||||
|
||||
loop.exec();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue