[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Nov 1 15:10:50 UTC 2019
vcl/unx/gtk3/gtk3gtkinst.cxx | 43 ++++++++++++++++++++++---------------------
1 file changed, 22 insertions(+), 21 deletions(-)
New commits:
commit 60692ba238c6c5c003722ccaa52702e9ef3ade13
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Nov 1 11:39:13 2019 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Nov 1 16:10:07 2019 +0100
the label sync button will relaunch itself from its close handler
so rearrange things so that runAsync can survive that
Change-Id: I7d40637fb861ceb64ce32f0e9ecb3451c0d17bad
Reviewed-on: https://gerrit.libreoffice.org/81884
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 6c318ce0bb91..1c225335753a 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4117,7 +4117,7 @@ public:
return;
if (GTK_IS_DIALOG(m_pDialog))
sort_native_button_order(GTK_BOX(gtk_dialog_get_action_area(GTK_DIALOG(m_pDialog))));
- gtk_widget_show(m_pWidget);
+ GtkInstanceWindow::show();
}
virtual void set_modal(bool bModal) override
@@ -6030,29 +6030,30 @@ void GtkInstanceDialog::asyncresponse(gint ret)
if (get_modal())
m_aDialogRun.dec_modal_count();
hide();
- m_aFunc(GtkToVcl(ret));
- if (m_nResponseSignalId)
- {
- g_signal_handler_disconnect(m_pDialog, m_nResponseSignalId);
- m_nResponseSignalId = 0;
- }
- if (m_nCancelSignalId)
- {
- g_signal_handler_disconnect(m_pDialog, m_nCancelSignalId);
- m_nCancelSignalId = 0;
- }
+ // move the self pointer, otherwise it might be de-allocated by time we try to reset it
+ auto xRunAsyncSelf = std::move(m_xRunAsyncSelf);
+ auto xDialogController = std::move(m_xDialogController);
+ auto aFunc = std::move(m_aFunc);
+
+ auto nResponseSignalId = m_nResponseSignalId;
+ auto nCancelSignalId = m_nCancelSignalId;
+ auto nSignalDeleteId = m_nSignalDeleteId;
+ m_nResponseSignalId = 0;
+ m_nCancelSignalId = 0;
+ m_nSignalDeleteId = 0;
+
+ aFunc(GtkToVcl(ret));
+
+ if (nResponseSignalId)
+ g_signal_handler_disconnect(m_pDialog, nResponseSignalId);
+ if (nCancelSignalId)
+ g_signal_handler_disconnect(m_pDialog, nCancelSignalId);
if (m_nSignalDeleteId)
- {
- g_signal_handler_disconnect(m_pDialog, m_nSignalDeleteId);
- m_nSignalDeleteId = 0;
- }
+ g_signal_handler_disconnect(m_pDialog, nSignalDeleteId);
- m_aFunc = nullptr;
- // move the self pointer, otherwise it might be de-allocated by time we try to reset it
- std::shared_ptr<weld::Dialog> me = std::move(m_xRunAsyncSelf);
- m_xDialogController.reset();
- me.reset();
+ xDialogController.reset();
+ xRunAsyncSelf.reset();
}
int GtkInstanceDialog::run()
More information about the Libreoffice-commits
mailing list