fix mem leak
fix ref count
Merge pull request #12 from dabingnn/master_fixMemoryLeak

Master fix memory leak