As you get involved in the upbringing of a family you lose time to the family and have less free time for your vices and hence they are no longer attractive. This is perpetuated if both parents are involved, if only one is involved, the other will continue their older lifestyle like usual.
Eventually their addiction will relapse but this can be a good impetus to control it and if effectively done can end the addiction for ever.
Still for some, it is tough and it will be difficult for them to balance both eventually leading to dysfunctional families.
Many families have fallen apart due to the head of the house getting addicted to gambling, this is not a good thing that your children must copy from anyone or you, while I was growing up, I can't even count how many times my parent has told me to stay away from any friends in school that's into gambling, my parent believes that they are all bad friends that can destroy my life.
I never took the advice very seriously, until the day that my parent told me about an uncle who was ruined because of his gambling addiction, I always thought it was something else because we heard he used to be rich, but we thought something bad happened to his business, until my father revealed that gambling ruined him.
Parents always play an important role in the lives of children, this must not be taken lightly, if anyone is already raising their child and also as a gambler, please and please be very non-friendly about it in front of your kids, because kids react differently to whatever they learn and some don't know how to stop when exposed to something.