fix bug 11010 - free discriptor only if the get was successful
authorchpeckha
Thu, 01 Apr 2010 11:55:03 -0500
changeset 1148 4fe29ed5e622
parent 1145 a9cc5c408e07
child 1154 5e766307f8d6
fix bug 11010 - free discriptor only if the get was successful
connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java
--- a/connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java	Wed Mar 31 12:09:18 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java	Thu Apr 01 11:55:03 2010 -0500
@@ -1047,6 +1047,8 @@
 				}
 		        if (DEBUG) System.out.println("getAllDeviceUSBPersonalities all devices read"); //$NON-NLS-1$
 				dwResult = library.UPAPI_FreeDeviceDescriptor(numUSBDevicesFound, pDeviceDescriptor);
+				if (DEBUG)
+					System.out.printf("UPAPI_FreeDeviceDescriptor dwResult = %x\n", dwResult); //$NON-NLS-1$
 			} else {
 				apiError = true;
 				if (DEBUG)
@@ -1077,12 +1079,14 @@
 
 			// get all the supported personalities for this device
 			apiError = getSupportedPersonalities(deviceInfo, pid, persDesc, numPers);
+			dwResult = library.UPAPI_FreePersonalityDescriptors(persDesc);
+			if (DEBUG)
+				System.out.printf("UPAPI_FreePersonalityDescriptors dwResult = %x\n", dwResult); //$NON-NLS-1$
 		} else {
 			apiError = true;
 			if (DEBUG)
 				System.out.printf("UPAPI_GetPersonalityDescriptors dwResult = %x\n", dwResult); //$NON-NLS-1$
 		}
-		dwResult = library.UPAPI_FreePersonalityDescriptors(persDesc);
 		if (apiError == false) {
 			if (DEBUG) System.out.println("getAllDeviceUSBPersonalities deviceInfo added"); //$NON-NLS-1$
 			p.add(deviceInfo);