Message: fix missing release of sd_bus_message

This commit is contained in:
Lukas Durfina
2018-06-19 08:56:28 +02:00
parent fd3799dbc3
commit dfdc6b153e

View File

@@ -48,6 +48,9 @@ Message::Message(const Message& other) noexcept
Message& Message::operator=(const Message& other) noexcept
{
if (msg_)
sd_bus_message_unref((sd_bus_message*)msg_);
msg_ = other.msg_;
type_ = other.type_;
ok_ = other.ok_;
@@ -64,6 +67,9 @@ Message::Message(Message&& other) noexcept
Message& Message::operator=(Message&& other) noexcept
{
if (msg_)
sd_bus_message_unref((sd_bus_message*)msg_);
msg_ = other.msg_;
other.msg_ = nullptr;
type_ = other.type_;