diff options
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 9e07e7a2cf..b3b934996c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -583,12 +583,14 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) priv = editor->priv; page_widget = comp_editor_page_get_widget (page); - + page_num = gtk_notebook_page_num (priv->notebook, page_widget); + if (page_num == -1) + return; + /* Disconnect all the signals added in append_page(). */ gtk_signal_disconnect_by_data (GTK_OBJECT (page), editor); gtk_signal_disconnect_by_data (GTK_OBJECT (page_widget), page); - page_num = gtk_notebook_page_num (priv->notebook, page_widget); gtk_notebook_remove_page (priv->notebook, page_num); priv->pages = g_list_remove (priv->pages, page); |