From f8fe5d1448a1699d4f9ae5e984e6ef2572fe5613 Mon Sep 17 00:00:00 2001 From: Quy Tonthat Date: Sun, 19 Aug 2007 15:12:43 +0000 Subject: [PATCH] Fix bugs that cause crashes on layers copy/paste/delete. The bug can be reproduced consistently by following steps: - start viking, create a map layer - select the map layer - click on copy - select some text on a terminal - right click on the selected text. At this stage, error messages appears such as: (viking:5219): GLib-GObject-WARNING **: invalid uninstantiatable type `(null)' in cast to `VikLayer' (viking:5219): Gdk-WARNING **: Error converting from UTF-8 to STRING: Invalid byte sequence in conversion input The memory is corrupted by then, other operations will crash viking eventually. Signed-off-by: Quy Tonthat --- ChangeLog | 4 ++++ src/clipboard.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74c23628..7b922e82 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-20 +Quy Tonthat : + * Fix bugs that cause crashes on layers copy/paste/delete. + 2007-08-16 Guilhem Bonnefille : * Group "Export Layer..." entries in a sub-menu. diff --git a/src/clipboard.c b/src/clipboard.c index 84ff6392..6f747ee1 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -51,11 +51,6 @@ static void clip_get ( GtkClipboard *c, GtkSelectionData *selection_data, guint // g_print("clip_get: vc = %p, size = %d\n", vc, sizeof(*vc) + vc->len); gtk_selection_data_set ( selection_data, selection_data->target, 8, (void *)vc, sizeof(*vc) + vc->len ); } - if (info==1) { - if (vc->type == VIK_CLIPBOARD_DATA_LAYER) { - gtk_selection_data_set_text ( selection_data, VIK_LAYER(vc->clipboard)->name, -1 ); - } - } } static void clip_clear ( GtkClipboard *c, gpointer p ) -- 2.39.5