Bo Peng wrote: > The real code is much more complicated and I can not possibly explain > the details here. Can anyone *guess* what might go wrong? Sorry, are you saying that the code you posted does NOT have a memory leak, but you want us to find the memory leak in your real code sight unseen? -- Steven.