wpa_supplicant(hidl): Invalidate objects in HidlManager

This is now needed with the new method handling mechanism in all HIDL
objects.

Bug: 32869248
Test: Compiles
Change-Id: Ic3718468997b5800935660b4c36715c48c928c14
diff --git a/wpa_supplicant/hidl/hidl_manager.cpp b/wpa_supplicant/hidl/hidl_manager.cpp
index c5705d1..90a0c22 100644
--- a/wpa_supplicant/hidl/hidl_manager.cpp
+++ b/wpa_supplicant/hidl/hidl_manager.cpp
@@ -91,9 +91,11 @@
     std::map<const std::string, android::sp<ObjectType>> &object_map)
 {
 	// Return failure if we dont have an object for that |key|.
-	if (object_map.find(key) == object_map.end())
+	const auto &object_iter = object_map.find(key);
+	if (object_iter == object_map.end())
 		return 1;
-	object_map.erase(key);
+	object_iter->second->invalidate();
+	object_map.erase(object_iter);
 	return 0;
 }