Fixes cancel rendering regression
Merge pull request #4724 from yurydelendik/issue4723

Fixes cancel rendering regression