i don't think you can call this a happy ending,,,voldemort killed him because he thought that snape was the owner of the elder wand (if you read the 6th potter book dumbledore was killed by snape but later harry will find out that snape didn't kill him)which is owned by dumbledore.then when harry found out what really happened in the pensieve he sort of loved snape in the end and he even named one of his kids after him.