fix some core memory manage fucntion bugs
just commit