The death of one of the rulers should end the war, so that's not a bug.
The main point of confusion (in this and some other issues) is that CK2 is designed around dynasties and not around countries. So if you are fighting a dude from one dynasty, and while you are fighting him he is being overthrown, than you should not be fighting the other dude that is replacing him.
The main point of confusion (in this and some other issues) is that CK2 is designed around dynasties and not around countries. So if you are fighting a dude from one dynasty, and while you are fighting him he is being overthrown, than you should not be fighting the other dude that is replacing him.