g_dbus_message_set_body(msg, g_variant_new("(is)", static_cast<int>(cmd),
reinterpret_cast<char*>(data.ToRaw().first.get())));
- std::pair<Command, RequestBroker*> param = std::make_pair(cmd, this);
+ auto param = new std::pair<Command, RequestBroker*>(cmd, this);
g_dbus_connection_send_message_with_reply(connection_, msg,
G_DBUS_SEND_MESSAGE_FLAGS_NONE, kTimeoutMsec, nullptr, nullptr,
[](GObject* source_object, GAsyncResult* res, gpointer user_data) {
auto param =
static_cast<std::pair<Command, RequestBroker*>*>(user_data);
+ std::unique_ptr<std::pair<Command, RequestBroker*>> param_auto(param);
GDBusConnection* conn =
reinterpret_cast<GDBusConnection*>(source_object);
GError* err = nullptr;
return;
it->second->GetHandler()->OnRequest(Command::RESULT, b);
},
- ¶m);
+ param);
}
} // namespace dbus