Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/http_rest_api_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,12 @@ struct V3StreamCallbackResourceGuard {
CopyableObjectWrapper<HttpPayload>& requestWrapper;
std::shared_ptr<HttpAsyncWriter>& serverReaderWriter;

V3StreamCallbackResourceGuard() = delete;
V3StreamCallbackResourceGuard(const V3StreamCallbackResourceGuard&) = delete;
V3StreamCallbackResourceGuard& operator=(const V3StreamCallbackResourceGuard&) = delete;
V3StreamCallbackResourceGuard& operator=(V3StreamCallbackResourceGuard&&) = delete;
V3StreamCallbackResourceGuard(V3StreamCallbackResourceGuard&&) = delete;

V3StreamCallbackResourceGuard(
CopyableObjectWrapper<MediapipeGraphExecutor>& executorWrapper,
CopyableObjectWrapper<HttpPayload>& requestWrapper,
Expand Down
9 changes: 9 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,21 @@ class ModulesShutdownGuard {
~ModulesShutdownGuard() {
this->server.shutdownModules();
}
ModulesShutdownGuard(const ModulesShutdownGuard&) = delete;
ModulesShutdownGuard& operator=(const ModulesShutdownGuard&) = delete;
ModulesShutdownGuard(ModulesShutdownGuard&&) = delete;
ModulesShutdownGuard& operator=(ModulesShutdownGuard&&) = delete;
};

class OvmsExitGuard {
Server& server;

public:
OvmsExitGuard() = delete;
OvmsExitGuard(const OvmsExitGuard&) = delete;
OvmsExitGuard& operator=(const OvmsExitGuard&) = delete;
OvmsExitGuard& operator=(OvmsExitGuard&&) = delete;
OvmsExitGuard(OvmsExitGuard&&) = delete;
Comment on lines +446 to +447
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of deleted special member functions is inconsistent. The move assignment operator appears before the move constructor, while in ModulesShutdownGuard the move constructor appears before the move assignment operator. For consistency and readability, follow the canonical order: copy constructor, copy assignment, move constructor, move assignment.

Suggested change
OvmsExitGuard& operator=(OvmsExitGuard&&) = delete;
OvmsExitGuard(OvmsExitGuard&&) = delete;
OvmsExitGuard(OvmsExitGuard&&) = delete;
OvmsExitGuard& operator=(OvmsExitGuard&&) = delete;

Copilot uses AI. Check for mistakes.
OvmsExitGuard(Server& server) :
server(server) { server.setExitStatus(0); }
~OvmsExitGuard() { server.setExitStatus(1); }
Expand Down