Man accused of bringing gun to court headed for divorce