diff --git a/widgets/misc/e-activity-handler.c b/widgets/misc/e-activity-handler.c
index e9aae86..795ba68 100644
--- a/widgets/misc/e-activity-handler.c
+++ b/widgets/misc/e-activity-handler.c
@@ -381,6 +381,7 @@ cancel_wrapper (gpointer pdata)
 	if (data->info->error) {
 		/* Hide the error */
 		EActivityHandler *handler = data->handler;
+		ActivityInfo *info;
 		int order, len;
 		GSList *sp;
 		GList *p = lookup_activity (handler->priv->activity_infos, data->id, &order);
@@ -388,13 +389,14 @@ cancel_wrapper (gpointer pdata)
 						    g_object_get_data (data->info->error, "secondary"));
 		gtk_widget_destroy (data->info->error);
 		data->info->error = NULL;
+		info = data->info;
 		for (sp = handler->priv->task_bars; sp != NULL; sp = sp->next) {
 			ETaskBar *task_bar;
 
 			task_bar = E_TASK_BAR (sp->data);
-			e_task_bar_remove_task_from_id (task_bar, data->info->id);	
+			e_task_bar_remove_task_from_id (task_bar, info->id);	
 		}
-		activity_info_free (data->info);
+		activity_info_free (info);
 		len = g_list_length (handler->priv->activity_infos);
 		handler->priv->activity_infos = g_list_remove_link (handler->priv->activity_infos, p);
 		if (len == 1)
