fix Issue 10475 - destructor is called on 'for' loop variable even when initialization failed
Merge pull request #2286 from 9rnsr/fix10475

Issue 10475 - destructor is called on 'for' loop variable even when initialization failed