Fix bug/warning about temporary object lifetime (#4374)

This commit is contained in:
Dimitrios Siganos 2024-01-20 00:54:33 +07:00 committed by GitHub
commit 87e7d4d784
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -64,7 +64,8 @@ std::shared_ptr<flatbuffers::Parser> nano::ipc::flatbuffers_handler::make_flatbu
throw nano::error ("Internal IPC error: unable to find api path");
}
char const * include_directories[] = { api_path->string ().c_str (), nullptr };
const std::string api_path_str = api_path->string ();
char const * include_directories[] = { api_path_str.c_str (), nullptr };
std::string schemafile;
if (!flatbuffers::LoadFile ((*api_path / "nanoapi.fbs").string ().c_str (), false, &schemafile))
{