Index: media/midi/midi_manager.cc |
diff --git a/media/midi/midi_manager.cc b/media/midi/midi_manager.cc |
index 5fe9f2139f0ff3d325b53a3478cec4b3caad3488..c5ec6559b3cf33c5e940c894a6401bc7c6f7d764 100644 |
--- a/media/midi/midi_manager.cc |
+++ b/media/midi/midi_manager.cc |
@@ -153,6 +153,11 @@ void MidiManager::AccumulateMidiBytesSent(MidiManagerClient* client, size_t n) { |
if (clients_.find(client) == clients_.end()) |
return; |
+ // Continue to hold lock_ here in case another thread is currently doing |
+ // EndSession. |
+ // Note that if we are in EndSession, then a destructor is being called and |
+ // it isn't really safe to call this method. But we don't have another way to |
+ // check this right now. |
client->AccumulateMidiBytesSent(n); |
} |