From 77e8749ee3722fd6610094d5750ac26c28c5ad29 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 24 Mar 2017 18:17:42 +0100 Subject: Fix: don't clean recurring request except if forced Change-Id: I669fc1f0b078e151dfb0cbb17c3d626bb43930d2 Signed-off-by: Romain Forlot --- src/diagnostic/diagnostic-manager.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/diagnostic/diagnostic-manager.cpp') diff --git a/src/diagnostic/diagnostic-manager.cpp b/src/diagnostic/diagnostic-manager.cpp index d236160..6ab3457 100644 --- a/src/diagnostic/diagnostic-manager.cpp +++ b/src/diagnostic/diagnostic-manager.cpp @@ -166,18 +166,17 @@ void diagnostic_manager_t::cancel_request(active_diagnostic_request_t* entry) /// @param[in] force - Force the cleaning or not ? void diagnostic_manager_t::cleanup_request(active_diagnostic_request_t* entry, bool force) { - if((force || (entry->get_in_flight() && entry->request_completed())) && entry != nullptr) + if((force || (entry != nullptr && entry->get_in_flight() && entry->request_completed()))) { entry->set_in_flight(false); char request_string[128] = {0}; diagnostic_request_to_string(&entry->get_handle()->request, request_string, sizeof(request_string)); - if(entry->get_recurring()) + if(force && entry->get_recurring()) { find_and_erase(entry, recurring_requests_); - if(force) - cancel_request(entry); + cancel_request(entry); DEBUG(binder_interface, "cleanup_request: Cancelling completed, recurring request: %s", request_string); } else -- cgit 1.2.3-korg