Merge pull request #4912 from nutty898/master_nutty_modify_framework_fixedmemleak

Fixed bugs and memory leak