Terminate Thread

Hi,
I am createing a thread in my mfc application in which I am playing video using Direct Show. But when I terminate thread then I am getting memory leak problem.
Please help me as soon as possible.
Following is code in which I am terminating thread: