Index: e-shell-view.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-view.c,v
retrieving revision 1.289
diff -r1.289 e-shell-view.c
46d45
< 	char *tmp = g_strdup_printf("%s - Evolution", title);
48,49c47,51
< 	e_shell_window_set_title(esw->window, id, tmp);
< 	g_free(tmp);
---
> 	if (esw->window) {
> 		char *tmp = g_strdup_printf("%s - Evolution", title);
> 		e_shell_window_set_title(esw->window, id, tmp);
> 		g_free(tmp);
> 	}
56,57c58,60
< 
< 	e_shell_window_switch_to_component(esw->window, id);
---
> 	
> 	if (esw->window)
> 		e_shell_window_switch_to_component(esw->window, id);
63,64d65
< 	/*EShellView *esv = (EShellView *)object;*/
< 
96c97,98
< EShellView *e_shell_view_new(struct _EShellWindow *window)
---
> static gboolean
> e_shell_view_on_window_destroy (GObject *object, gpointer data)
98c100,103
< 	EShellView *new = g_object_new (e_shell_view_get_type (), NULL);
---
> 	EShellView *esv = (EShellView *)data;
>         esv->window = NULL;
>         return TRUE;
> }
100,101c105,107
< 	/* TODO: listen to destroy? */
< 	new->window = window;
---
> EShellView *e_shell_view_new(struct _EShellWindow *window)
> {
> 	EShellView *esv = g_object_new (e_shell_view_get_type (), NULL);
103c109,113
< 	return new;
---
> 	esv->window = window;
> 	g_signal_connect_object (window, "destroy", 
> 				 e_shell_view_on_window_destroy, 
> 				 esv, 0);
> 	return esv;
