Fix bug 11010 - free descriptor only if get was successful - merge from 3.0 RCL_2_4
authorChad Peckham <chad.peckham@nokia.com>
Thu, 01 Apr 2010 12:02:17 -0500
branchRCL_2_4
changeset 1149 73a397acd93c
parent 1147 c2836b036bd5
child 1152 0af9cb0ed84e
Fix bug 11010 - free descriptor only if get was successful - merge from 3.0
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 16:21:55 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/PCCSConnection.java	Thu Apr 01 12:02:17 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);