diff options
author | Martin Szulecki | 2013-08-18 05:23:28 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-09-17 11:43:33 +0200 |
commit | 36e636a727ecbae7083878ceb493b26046a47179 (patch) | |
tree | 3707341fff86902d8dba9590ecd3e20406db0c8f /src | |
parent | df539bdbc7708fb05eea22eec62d6e2f609c10b5 (diff) | |
download | libimobiledevice-36e636a727ecbae7083878ceb493b26046a47179.tar.gz libimobiledevice-36e636a727ecbae7083878ceb493b26046a47179.tar.bz2 |
idevice: Add udid attribute to idevice_connection_t for referencing devices
Diffstat (limited to 'src')
-rw-r--r-- | src/idevice.c | 6 | ||||
-rw-r--r-- | src/idevice.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c index f0d89df..c605da3 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -238,6 +238,7 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect new_connection->type = CONNECTION_USBMUXD; new_connection->data = (void*)(long)sfd; new_connection->ssl_data = NULL; + idevice_get_udid(device, &new_connection->udid); *connection = new_connection; return IDEVICE_E_SUCCESS; } else { @@ -270,7 +271,12 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection) } else { debug_info("Unknown connection type %d", connection->type); } + + if (connection->udid) + free(connection->udid); + free(connection); + return result; } diff --git a/src/idevice.h b/src/idevice.h index 4aeaf33..01b13df 100644 --- a/src/idevice.h +++ b/src/idevice.h @@ -58,6 +58,7 @@ struct ssl_data_private { typedef struct ssl_data_private *ssl_data_t; struct idevice_connection_private { + char *udid; enum connection_type type; void *data; ssl_data_t ssl_data; |