diff options
| author | bulia byak <buliabyak@gmail.com> | 2006-08-18 06:09:10 +0000 |
|---|---|---|
| committer | buliabyak <buliabyak@users.sourceforge.net> | 2006-08-18 06:09:10 +0000 |
| commit | f13538597fe1ba11c9e4f85f53dc338c3daf1eda (patch) | |
| tree | d7e51c4646089d34b3ff99341994da19ad2d14e3 /src/widgets/toolbox.cpp | |
| parent | disconnect signals on destroying (diff) | |
| download | inkscape-f13538597fe1ba11c9e4f85f53dc338c3daf1eda.tar.gz inkscape-f13538597fe1ba11c9e4f85f53dc338c3daf1eda.zip | |
delete completion object on destroying, prevents a crash on exit
(bzr r1614)
Diffstat (limited to 'src/widgets/toolbox.cpp')
| -rw-r--r-- | src/widgets/toolbox.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 0849bda64..ed9259aef 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -3413,6 +3413,14 @@ cell_data_func (GtkTreeViewColumn *column, free (sample_escaped); } +static void delete_completion(GObject *obj, GtkWidget *entry) { + GObject *completion = (GObject *) gtk_object_get_data(GTK_OBJECT(entry), "completion"); + if (completion) { + gtk_entry_set_completion (GTK_ENTRY(entry), NULL); + g_object_unref (completion); + } +} + GtkWidget* sp_text_toolbox_new (SPDesktop *desktop) { @@ -3438,8 +3446,10 @@ sp_text_toolbox_new (SPDesktop *desktop) gtk_entry_completion_set_minimum_key_length (completion, 1); g_object_set (G_OBJECT(completion), "inline-completion", TRUE, "popup-completion", TRUE, NULL); gtk_entry_set_completion (GTK_ENTRY(entry), completion); + gtk_object_set_data(GTK_OBJECT(entry), "completion", completion); aux_toolbox_space (tbl, 1); gtk_box_pack_start (GTK_BOX (tbl), entry, FALSE, FALSE, 0); + g_signal_connect(G_OBJECT(tbl), "destroy", G_CALLBACK(delete_completion), entry); //Button GtkWidget *button = gtk_button_new (); |
