TSA layout engine: Fix reference counting / memory leak issues.
TSA layout engine: Fix reference counting / memory leak issues.

thpatch/thcrap,thpatch/thcrap,VBChunguk/thcrap,VBChunguk/thcrap,thpatch/thcrap,thpatch/thcrap,VBChunguk/thcrap,thpatch/thcrap