Fix crash introduced by clipboard support (#827756)

epel8
Christoph Wickert 13 years ago
parent 8a5eb05ef5
commit 75c2aae559

@ -0,0 +1,53 @@
From c1ef3a162622942d7c556c5a4352e626c7bcb28f Mon Sep 17 00:00:00 2001
From: Jean-Louis Dupond <jean-louis@dupond.be>
Date: Tue, 8 May 2012 14:44:16 +0200
Subject: [PATCH] Disconnect signal handler after disconnect
---
remmina-plugins/rdp/rdp_event.c | 10 ++++++++--
remmina-plugins/rdp/rdp_plugin.h | 1 +
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/remmina-plugins/rdp/rdp_event.c b/remmina-plugins/rdp/rdp_event.c
index a936fb1..2c050c6 100644
--- a/remmina-plugins/rdp/rdp_event.c
+++ b/remmina-plugins/rdp/rdp_event.c
@@ -523,8 +523,7 @@ void remmina_rdp_event_init(RemminaProtocolWidget* gp)
if (!remmina_plugin_service->file_get_int(remminafile, "disableclipboard", FALSE))
{
clipboard = gtk_widget_get_clipboard(rfi->drawing_area, GDK_SELECTION_CLIPBOARD);
- g_signal_connect(clipboard, "owner-change",
- G_CALLBACK(remmina_rdp_event_on_clipboard), gp);
+ rfi->clipboard_handler = g_signal_connect(clipboard, "owner-change", G_CALLBACK(remmina_rdp_event_on_clipboard), gp);
}
rfi->pressed_keys = g_array_new(FALSE, TRUE, sizeof (gint));
@@ -575,6 +574,13 @@ void remmina_rdp_event_uninit(RemminaProtocolWidget* gp)
rfi = GET_DATA(gp);
+
+ /* unregister the clipboard monitor */
+ if (rfi->clipboard_handler)
+ {
+ g_signal_handler_disconnect(G_OBJECT(gtk_widget_get_clipboard(rfi->drawing_area, GDK_SELECTION_CLIPBOARD)), rfi->clipboard_handler);
+ rfi->clipboard_handler = NULL;
+ }
if (rfi->scale_handler)
{
g_source_remove(rfi->scale_handler);
diff --git a/remmina-plugins/rdp/rdp_plugin.h b/remmina-plugins/rdp/rdp_plugin.h
index ff66906..08b8891 100644
--- a/remmina-plugins/rdp/rdp_plugin.h
+++ b/remmina-plugins/rdp/rdp_plugin.h
@@ -134,6 +134,7 @@ struct rf_context
GAsyncQueue* event_queue;
gint event_pipe[2];
+ gint clipboard_handler;
gint clipboard_wait;
uint32 requested_format;
};
--
1.7.10

@ -2,7 +2,7 @@
Name: remmina
Version: 1.0.0
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Remote Desktop Client
Group: Applications/Internet
@ -17,18 +17,20 @@ Patch0: remmina-1.0.0-fix-library-name.patch
# https://github.com/FreeRDP/Remmina/commit/13f20367
Patch1: remmina-1.0.0-linker-error.patch
# The following 3 patches are needed to add clipboard support (#818155)
# The following 4 patches are needed to add clipboard support (#818155)
# https://github.com/FreeRDP/Remmina/commit/3ebdd6e7
Patch2: remmina-1.0.0-add-clipboard-support.patch
# https://github.com/FreeRDP/Remmina/commit/97c2af8c
Patch3: remmina-1.0.0-clipboard-bugfix.patch
# https://github.com/FreeRDP/Remmina/commit/84327f81
Patch4: remmina-1.0.0-some-more-clipboard-fixes.patch
# https://github.com/FreeRDP/Remmina/commit/c1ef3a16
Patch5: remmina-1.0.0-disconnect-signal-handler-after-disconnect.patch
# https://github.com/FreeRDP/Remmina/commit/6ee20289
Patch5: remmina-1.0.0-fix-crashes-in-some-cases.patch
Patch10: remmina-1.0.0-fix-crashes-in-some-cases.patch
# https://github.com/FreeRDP/Remmina/commit/b2277827
Patch6: remmina-1.0.0-fix-memory-leak.patch
Patch11: remmina-1.0.0-fix-memory-leak.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -196,9 +198,10 @@ client.
%patch2 -p1 -b .add-clipboard-support
%patch3 -p1 -b .clipboard-bugfix
%patch4 -p1 -b .some-more-clipboard-fixes
%patch5 -p1 -b .disconnect-signal-handler
%patch5 -p1 -b .fix-crashes-in-some-cases
%patch6 -p1 -b .fix-memory-leak
%patch10 -p1 -b .fix-crashes-in-some-cases
%patch11 -p1 -b .fix-memory-leak
# Don't hardcode libdir
sed -i "s,/lib/remmina/plugins,/%{_lib}/remmina/plugins,g" CMakeLists.txt
@ -330,6 +333,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog
* Sun Jun 03 2012 Christoph Wickert <cwickert@fedoraproject.org> - 1.0.0-3
- Fix crash introduced by clipboard support (#827756)
* Fri Jun 01 2012 Christoph Wickert <cwickert@fedoraproject.org> - 1.0.0-2
- Add clipboard support (#818155)
- Fix a memory leak and a crash

Loading…
Cancel
Save