the primary_selection_source_destroy list points to memory freed by that cancel callback, so remove from list before freeing