Catch the fleas on the comb and dip them into a can of hot water which you have handy. Much more pleasant than trying to squash them.
Sometimes they manage to jump off the comb, though. I suppose they get right back on the pet and get caught next time.