mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 08:04:01 +02:00
Copy _type in assignment operators
This commit is contained in:
parent
a2a60f253c
commit
aaafa7acd2
1 changed files with 4 additions and 0 deletions
|
@ -68,6 +68,8 @@ Packet::Packet(const Packet& other) {
|
|||
}
|
||||
|
||||
Packet& Packet::operator=(const Packet& other) {
|
||||
_type = other._type;
|
||||
|
||||
_packetSize = other._packetSize;
|
||||
_packet = std::unique_ptr<char>(new char(_packetSize));
|
||||
memcpy(_packet.get(), other._packet.get(), _packetSize);
|
||||
|
@ -85,6 +87,8 @@ Packet::Packet(Packet&& other) {
|
|||
}
|
||||
|
||||
Packet& Packet::operator=(Packet&& other) {
|
||||
_type = other._type;
|
||||
|
||||
_packetSize = other._packetSize;
|
||||
_packet = std::move(other._packet);
|
||||
|
||||
|
|
Loading…
Reference in a new issue