Dependent's visa status when/if the primary MM2H visa holder dies?

My husband and I are Americans who have been living on retirement visas in Chiang Mai, Thailand for nearly nine years.  When we first came, I was carried as a dependent on my husband's retirement visa since he has pension income and I was too young to start my pension.  However, Thailand permits someone to financially justify their retirement visa either with income or a deposit in a Thai bank and we decided to bring funds into Thailand for a "retirement visa bank account" in my name so I could obtain my own, independent retirement visa.

The funds needed are about RM 100,000 (800,000 baht) and earn interest similar to what you earn on your Malaysian visa bank deposits. 

We decided to make the move after learning of horror stories of expat women who lost their ability to stay in Thailand when their husbands died.  Their visa status ended when the marriage ended.  Even with a Final Will in place, in usually takes 30 - 45 days to claim bank accounts and life insurance so that a widow will have sufficient funds in her name to justify her own retirement visa.  Thai Immigration gives just 7 days after the end of a marriage to leave the country and make other visa arrangements, like getting a tourist visa from a consulate/embassy in a neighboring country.

What happens in Malaysia if a husband, the holder of a MM2H visa dies?  Does the wife have to clear out right away?  At least in Malaysia, U.S. citizens get 90 day visa-exempt entry (unlike 30 days in Thailand), so a border run could gain enough time to sort out the finances.  But still, a quick trip out of the country isn't something most new widows would want to do.

Great question!  I know with a spouse visa, in the event of the death of the Malaysian spouse I can't renew, but can stay until my current visa expires (5 years on my current visa). Hopeful to have a PR when my current visa expires, but don't expect it. The time to get a PR is a minimum of 5 years, but have heard of it taking up to 15 years.

Thanks, iskandarhack.  This is a reasonable policy and you'd think that Thai Immigration would follow a similar policy, but they don't.  I know several who have been caught with Thailand's policy of "your visa dies when the marriage ends", be it expat men married to Thai ladies on a marriage visa or expat ladies carried as dependents on their husband's visa.  They get hit with a hefty overstay fine when they go to apply for their own visa once their current annual permission to stay stamped in their passport expires.

If the principal unfortunately pass away, the spouse and child still wanted to stay in Malaysia, you can apply to transfer the principal.