Memory leak
-
HI, A::a (EStationID eStnID, VARIANT *pvtConTypes) { ::CComSafeArray csaConType; CComVariant varContTypes; csaConType.CreateOneDim(VT_BSTR,4); CComBSTR bstrName("Sim_Model1"); CComBSTR bstrName1("Sim_Model2"); CComBSTR bstrName2("Sim_Model3"); CComBSTR bstrName3("Sim_Model4"); csaConType.PutElement((long)0,bstrName.Copy()); csaConType.PutElement(1,bstrName1.Copy()); csaConType.PutElement(2,bstrName2.Copy()); csaConType.PutElement(3,bstrName3.Copy()); *pvtConTypes = csaConType.Detach(); can anyone please tell whether memory leak will occur in this code how to solve it
-
HI, A::a (EStationID eStnID, VARIANT *pvtConTypes) { ::CComSafeArray csaConType; CComVariant varContTypes; csaConType.CreateOneDim(VT_BSTR,4); CComBSTR bstrName("Sim_Model1"); CComBSTR bstrName1("Sim_Model2"); CComBSTR bstrName2("Sim_Model3"); CComBSTR bstrName3("Sim_Model4"); csaConType.PutElement((long)0,bstrName.Copy()); csaConType.PutElement(1,bstrName1.Copy()); csaConType.PutElement(2,bstrName2.Copy()); csaConType.PutElement(3,bstrName3.Copy()); *pvtConTypes = csaConType.Detach(); can anyone please tell whether memory leak will occur in this code how to solve it
Please post on the correct forum, this one is for Windows Vista specific problems. regards,
Jonathan Wilkes Darka[Xanya.net]
-
HI, A::a (EStationID eStnID, VARIANT *pvtConTypes) { ::CComSafeArray csaConType; CComVariant varContTypes; csaConType.CreateOneDim(VT_BSTR,4); CComBSTR bstrName("Sim_Model1"); CComBSTR bstrName1("Sim_Model2"); CComBSTR bstrName2("Sim_Model3"); CComBSTR bstrName3("Sim_Model4"); csaConType.PutElement((long)0,bstrName.Copy()); csaConType.PutElement(1,bstrName1.Copy()); csaConType.PutElement(2,bstrName2.Copy()); csaConType.PutElement(3,bstrName3.Copy()); *pvtConTypes = csaConType.Detach(); can anyone please tell whether memory leak will occur in this code how to solve it
What does this have to do with Vista? This forum is specific for Vista problems and not programming problems, unless they are directly related to Vista.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus