From: Martti Rannanjärvi Date: Wed, 29 Mar 2017 17:04:47 +0000 (+0300) Subject: push-notification-driver-ox: Wait for http requests to finish in deinit X-Git-Tag: 2.3.0.rc1~1845 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=620ddd4ab772dad26afc439745cbcb2944139b9a;p=thirdparty%2Fdovecot%2Fcore.git push-notification-driver-ox: Wait for http requests to finish in deinit This is to make sure mail_user is still usable in http response callback. --- diff --git a/src/plugins/push-notification/push-notification-driver-ox.c b/src/plugins/push-notification/push-notification-driver-ox.c index 9dcc7a8efe..efdda3f7dc 100644 --- a/src/plugins/push-notification/push-notification-driver-ox.c +++ b/src/plugins/push-notification/push-notification-driver-ox.c @@ -406,6 +406,7 @@ static void push_notification_driver_ox_deinit i_free(dconfig->cached_ox_metadata); if (ox_global != NULL) { + http_client_wait(ox_global->http_client); i_assert(ox_global->refcount > 0); --ox_global->refcount; } @@ -415,7 +416,6 @@ static void push_notification_driver_ox_cleanup(void) { if ((ox_global != NULL) && (ox_global->refcount <= 0)) { if (ox_global->http_client != NULL) { - http_client_wait(ox_global->http_client); http_client_deinit(&ox_global->http_client); } i_free_and_null(ox_global);