Fixed bugs and memory leak
Modify wrong codes
Merge branch 'master' into master_nutty_modify_framework_fixedmemleak
Merge pull request #4912 from nutty898/master_nutty_modify_framework_fixedmemleak

Fixed bugs and memory leak