This is an important subject. I spent many years doing rescue and it was heartbreaking to watch family members dump the animals that were loved by the deceased. At the same time, it was heartbreaking to watch family members have to give up that loved pet because their life situation was not compatible with the pet.
There's a fine line there and it's tough for everyone.
Another thing to remember is to have a designated decision maker. Because situations change, that person who has agreed to take in your beloved pet if something happens to you may not be in a position to do so when the time comes. In that case, it is best to identify someone you trust to make alternate arrangements for your pet.