fixed memory leak on minimized due to missing deletion of unused textures (fixes parts of #14245)
Merge pull request #2540 from wsoltys/14245

fixed memory leak on minimized due to missing deletion of unused textures (fixes #14245)