# HG changeset patch # User chpeckha # Date 1270140903 18000 # Node ID 4fe29ed5e622fc641dddc70197b47772054c814f # Parent a9cc5c408e0748a833ee2209d64f514cf0c4504c fix bug 11010 - free discriptor only if the get was successful diff -r a9cc5c408e07 -r 4fe29ed5e622 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);