Using the same approach as in the register - hide the widgets before removing them. BUG: 311752 (cherry picked from commit 0dec8fb4)