diff options
Diffstat (limited to 'src/dev/sinic.cc')
-rw-r--r-- | src/dev/sinic.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dev/sinic.cc b/src/dev/sinic.cc index 7da70c482..798fb17ef 100644 --- a/src/dev/sinic.cc +++ b/src/dev/sinic.cc @@ -1056,7 +1056,7 @@ Device::txKick() assert(Regs::get_TxDone_Busy(vnic->TxDone)); if (!txPacket) { // Grab a new packet from the fifo. - txPacket = new EthPacketData(16384); + txPacket = make_shared<EthPacketData>(16384); txPacketOffset = 0; } @@ -1403,7 +1403,7 @@ Device::serialize(std::ostream &os) SERIALIZE_SCALAR(txState); SERIALIZE_SCALAR(txFull); txFifo.serialize("txFifo", os); - bool txPacketExists = txPacket; + bool txPacketExists = txPacket != nullptr; SERIALIZE_SCALAR(txPacketExists); if (txPacketExists) { txPacket->serialize("txPacket", os); @@ -1498,7 +1498,7 @@ Device::unserialize(Checkpoint *cp, const std::string §ion) UNSERIALIZE_SCALAR(txPacketExists); txPacket = 0; if (txPacketExists) { - txPacket = new EthPacketData(16384); + txPacket = make_shared<EthPacketData>(16384); txPacket->unserialize("txPacket", cp, section); UNSERIALIZE_SCALAR(txPacketOffset); UNSERIALIZE_SCALAR(txPacketBytes); |