fix leaking issue
Revert "fix leaking issue"

This reverts commit 2dec036bf9599eb1cef135469e17a61550437645.
Revert "Revert "fix leaking issue""

This reverts commit fd57e50eddcd61936da211f47ad45f1f46b6d668.
Added missing file
merge files