diff --git a/runtime/rpc_server.cpp b/runtime/rpc_server.cpp index 1194ed8..6fedf84 100644 --- a/runtime/rpc_server.cpp +++ b/runtime/rpc_server.cpp @@ -58,7 +58,7 @@ auto slige_rpc::RpcServer::listen() -> Res } auto req = sliger::json::parse_json(message); auto writer = BufferedWriter(client); - this->functor(req, writer); + this->functor(req, std::move(writer)); message.clear(); break; } diff --git a/runtime/rpc_server.hpp b/runtime/rpc_server.hpp index 6e3b9c2..fcf84ae 100644 --- a/runtime/rpc_server.hpp +++ b/runtime/rpc_server.hpp @@ -63,6 +63,10 @@ public: : fd(fd) { } + BufferedWriter(const BufferedWriter&) = delete; + BufferedWriter operator=(const BufferedWriter&) = delete; + BufferedWriter(BufferedWriter&&) = delete; + BufferedWriter operator=(BufferedWriter&&) = delete; ~BufferedWriter() { close(fd); } auto flush() -> Res;