fix share memory leak
Merge pull request #13 from shenyan1/v3

fix share memory leak