Fix memory leak in clear, and hinting
Merge pull request #1 from Nijikokun/hotfix/memory-leak-cleanup

Fix memory leak in clear, and hinting