From 5722838a8ed8d42200c82831f166eee154e525cc Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 10 May 2022 12:44:55 +0200 Subject: idevice: Restore original behavior for idevice_event_unsubscribe() Due to an implementation detail from the past, a call to idevice_event_unsubscribe would not cause the callback function to be called with IDEVICE_DEVICE_REMOVE events, even though originally it was planned to be that way. Due to the internal changes for the newer idevice_events_subscribe/unsubscribe API, that behavior changed and it would call the callback. Now to not break current software implementations depending on the original behavior we modify the old API to behave the same as before the change. --- src/idevice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/idevice.c b/src/idevice.c index c8574fc..3984583 100644 --- a/src/idevice.c +++ b/src/idevice.c @@ -296,6 +296,7 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_event_unsubscribe(void) if (!event_ctx) { return IDEVICE_E_SUCCESS; } + event_ctx->callback = NULL; return idevice_events_unsubscribe(event_ctx); } -- cgit v1.1-32-gdbae