Skip to content

Commit

Permalink
Fix memory leak in dbus::ObjectManager::RemoveInterface
Browse files Browse the repository at this point in the history
D-Bus Object Manager proxy class was leaking PropertySet object instances
stored in properties_map when an interface was removed.

Make sure we delete the PropertySet before we remove the map entry.

BUG=472654

Review URL: https://codereview.chromium.org/1055713002

Cr-Commit-Position: refs/heads/master@{#323544}
  • Loading branch information
avakulenko authored and Commit bot committed Apr 2, 2015
1 parent e09b357 commit 9a99965
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dbus/object_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ void ObjectManager::RemoveInterface(const ObjectPath& object_path,
interface->ObjectRemoved(object_path, interface_name);
}

delete piter->second;
object->properties_map.erase(piter);

if (object->properties_map.empty()) {
Expand Down

0 comments on commit 9a99965

Please sign in to comment.