Commit 5166767e authored by Benjamin Otte's avatar Benjamin Otte

Merge branch '169-gtktextview-accesses-already-disposed-object' into 'master'

Resolve "GtkTextView accesses already disposed object"

Closes #169

See merge request GNOME/gtk!109
parents bf6aafe4 0abf8efd
......@@ -6981,17 +6981,20 @@ typedef struct
SelectionGranularity granularity;
GtkTextMark *orig_start;
GtkTextMark *orig_end;
GtkTextBuffer *buffer;
} SelectionData;
static void
selection_data_free (SelectionData *data)
{
if (data->orig_start != NULL)
gtk_text_buffer_delete_mark (gtk_text_mark_get_buffer (data->orig_start),
data->orig_start);
gtk_text_buffer_delete_mark (data->buffer, data->orig_start);
if (data->orig_end != NULL)
gtk_text_buffer_delete_mark (gtk_text_mark_get_buffer (data->orig_end),
data->orig_end);
gtk_text_buffer_delete_mark (data->buffer, data->orig_end);
g_object_unref (data->buffer);
g_slice_free (SelectionData, data);
}
......@@ -7271,6 +7274,7 @@ gtk_text_view_start_selection_drag (GtkTextView *text_view,
&orig_start, TRUE);
data->orig_end = gtk_text_buffer_create_mark (buffer, NULL,
&orig_end, TRUE);
data->buffer = g_object_ref (buffer);
gtk_text_view_check_cursor_blink (text_view);
g_object_set_qdata_full (G_OBJECT (priv->drag_gesture),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment