fix potential crash when user remove self in widgets callback
Merge pull request #7649 from andyque/fixPotentialCarshWhenRemoveSelfInCallback

fix potential crash when user remove self in widgets callback