Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
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
8 changes: 7 additions & 1 deletion engine/controllers/process_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ void ProcessManager::destroy(
std::function<void(const HttpResponsePtr&)>&& callback) {
auto loaded_engines = engine_service_->GetSupportedEngineNames();
for (const auto& engine : loaded_engines.value()) {
engine_service_->UnloadEngine(engine);
auto result = engine_service_->UnloadEngine(engine);
if (!result) {
// Handle the error if any.
// Log the Error
LOG_ERROR << "Error unloading engine: " << result.error();
continue;
}
}
app().quit();
Json::Value ret;
Expand Down
9 changes: 8 additions & 1 deletion engine/services/hardware_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,14 @@ void HardwareService::UpdateHardwareInfos() {
};
for (auto const& he : b.value()) {
if (!exists(he.uuid)) {
db_service_->DeleteHardwareEntry(he.uuid);
auto result = db_service_->DeleteHardwareEntry(he.uuid);
if (!result) {
// Handle the error if any.
// Log the Error
LOG_ERROR << "Error deleting hardware entry " << he.uuid << ": "
<< result.error();
continue;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions engine/utils/command_executor.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CommandExecutor {
if (!pipe) {
throw std::runtime_error("popen() failed!");
}
m_pipe = std::unique_ptr<FILE, decltype(&PCLOSE)>(pipe, PCLOSE);
m_pipe = std::unique_ptr<FILE, void (*)(FILE*)>(pipe, [](FILE* file) { if (file) { PCLOSE(file); } });
}

CommandExecutor(const CommandExecutor&) = delete;
Expand All @@ -46,5 +46,5 @@ class CommandExecutor {
}

private:
std::unique_ptr<FILE, decltype(&PCLOSE)> m_pipe{nullptr, PCLOSE};
std::unique_ptr<FILE, void (*)(FILE*)> m_pipe{nullptr, [](FILE* file) { if (file) { PCLOSE(file); } }};
};
Loading