fix Issue 10789 - Struct destructor erroneously called
Merge pull request #2523 from 9rnsr/fix10789

[REG2.061] Issue 10789 - Struct destructor erroneously called