OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "dbus/object_manager.h" | 5 #include "dbus/object_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 return; | 475 return; |
476 | 476 |
477 // Inform the interface before removing the properties structure or object | 477 // Inform the interface before removing the properties structure or object |
478 // in case it needs details from them to make its own decisions. | 478 // in case it needs details from them to make its own decisions. |
479 InterfaceMap::iterator iiter = interface_map_.find(interface_name); | 479 InterfaceMap::iterator iiter = interface_map_.find(interface_name); |
480 if (iiter != interface_map_.end()) { | 480 if (iiter != interface_map_.end()) { |
481 Interface* interface = iiter->second; | 481 Interface* interface = iiter->second; |
482 interface->ObjectRemoved(object_path, interface_name); | 482 interface->ObjectRemoved(object_path, interface_name); |
483 } | 483 } |
484 | 484 |
| 485 delete piter->second; |
485 object->properties_map.erase(piter); | 486 object->properties_map.erase(piter); |
486 | 487 |
487 if (object->properties_map.empty()) { | 488 if (object->properties_map.empty()) { |
488 object_map_.erase(oiter); | 489 object_map_.erase(oiter); |
489 delete object; | 490 delete object; |
490 } | 491 } |
491 } | 492 } |
492 | 493 |
493 void ObjectManager::NameOwnerChanged(const std::string& old_owner, | 494 void ObjectManager::NameOwnerChanged(const std::string& old_owner, |
494 const std::string& new_owner) { | 495 const std::string& new_owner) { |
(...skipping 22 matching lines...) Expand all Loading... |
517 RemoveInterface(object_path, *iiter); | 518 RemoveInterface(object_path, *iiter); |
518 } | 519 } |
519 | 520 |
520 } | 521 } |
521 | 522 |
522 if (!new_owner.empty()) | 523 if (!new_owner.empty()) |
523 GetManagedObjects(); | 524 GetManagedObjects(); |
524 } | 525 } |
525 | 526 |
526 } // namespace dbus | 527 } // namespace dbus |
OLD | NEW |