Index: net/quic/test_tools/quic_connection_peer.cc |
diff --git a/net/quic/test_tools/quic_connection_peer.cc b/net/quic/test_tools/quic_connection_peer.cc |
index e51fb52480ac5f603ae1f06b60e9245d35fe25a1..c4c63c7bc30b92780f2ef39baace65cf6364bcae 100644 |
--- a/net/quic/test_tools/quic_connection_peer.cc |
+++ b/net/quic/test_tools/quic_connection_peer.cc |
@@ -208,8 +208,13 @@ QuicPacketWriter* QuicConnectionPeer::GetWriter(QuicConnection* connection) { |
// static |
void QuicConnectionPeer::SetWriter(QuicConnection* connection, |
- QuicPacketWriter* writer) { |
+ QuicPacketWriter* writer, |
+ bool owns_writer) { |
+ if (connection->owns_writer_) { |
+ delete connection->writer_; |
+ } |
connection->writer_ = writer; |
+ connection->owns_writer_ = owns_writer; |
} |
// static |