[Core] Fixed new render loop to process correctly form closing and switching between render controls.