fixed memory usage issue in cppbind