fix Issue 12915 - RedBlackTree leaks memory
Merge pull request #2625 from MartinNowak/fix12915

fix Issue 12915 - RedBlackTree leaks memory