Revert part of #3108 to avoid rendering garbage memory
Merge pull request #3251 from raven02/patch-7

Revert part of #3108 to avoid rendering garbage memory