From what I can tell, flags aren't (always) automatically cleared if a post is deleted by its author. This should be the case, at least for a wide range of flags:
- Migration requests: no point in migrating a deleted question (it's probably been reposted, or else the asker doesn't case after all)
- “not an answer” or “very low quality”, obviously; ditto close requests;
found duplicate post copied postidentical post: this is a bit different, in that the flag is on the second post, but often the first was deleted (because the answerer realized he'd answered the wrong question).
I think all canned flags should be deleted when their post is deleted. Most custom flags become obsolete, but not all (e.g. user merge requests), so I'd err on the side of caution there.
Example of a flag which should have been cleared automatically:
I can't find an example of an obsolete identical-post flag in the queue right now, but I've definitely seen them in the past.