summaryrefslogtreecommitdiffstats
path: root/src/notification_proxy.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2014-12-26 12:23:52 +0100
committerGravatar Martin Szulecki2015-01-13 00:14:55 +0100
commitf3c4db4f30731f6cfc2c37a39d5ce3501d42f45e (patch)
treecaa0ffcfdd84a31c945408e9e7ccd56b72318e2e /src/notification_proxy.c
parentaa14c053bc909c56d31c12799f13013f845ddb71 (diff)
downloadlibimobiledevice-f3c4db4f30731f6cfc2c37a39d5ce3501d42f45e.tar.gz
libimobiledevice-f3c4db4f30731f6cfc2c37a39d5ce3501d42f45e.tar.bz2
thread: Introduce thread_new and thread_free to cover handle leaks on WIN32
Diffstat (limited to 'src/notification_proxy.c')
-rw-r--r--src/notification_proxy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/notification_proxy.c b/src/notification_proxy.c
index 4b028f6..b22448d 100644
--- a/src/notification_proxy.c
+++ b/src/notification_proxy.c
@@ -131,6 +131,8 @@ LIBIMOBILEDEVICE_API np_error_t np_client_free(np_client_t client)
if (client->notifier) {
debug_info("joining np callback");
thread_join(client->notifier);
+ thread_free(client->notifier);
+ client->notifier = (thread_t)NULL;
} else {
dict = NULL;
property_list_service_receive_plist(parent, &dict);
@@ -347,6 +349,7 @@ LIBIMOBILEDEVICE_API np_error_t np_set_notify_callback( np_client_t client, np_n
property_list_service_client_t parent = client->parent;
client->parent = NULL;
thread_join(client->notifier);
+ thread_free(client->notifier);
client->notifier = (thread_t)NULL;
client->parent = parent;
}
@@ -358,7 +361,7 @@ LIBIMOBILEDEVICE_API np_error_t np_set_notify_callback( np_client_t client, np_n
npt->cbfunc = notify_cb;
npt->user_data = user_data;
- if (thread_create(&client->notifier, np_notifier, npt) == 0) {
+ if (thread_new(&client->notifier, np_notifier, npt) == 0) {
res = NP_E_SUCCESS;
}
}