#include <glib.h>
#include <string>
+#include <memory>
#include <nnstreamer_cppplugin_api_filter.hh>
#include <nnstreamer_log.h>
#include <nnstreamer_util.h>
value = (double) ((uint64_t *) lt->data)[tidx];
break;
default:
- throw std::runtime_error ("Error occured during get tensor value");
+ throw std::runtime_error ("Error occurred during get tensor value");
break;
}
break;
}
default:
- throw std::runtime_error ("Error occured during set tensor value");
+ throw std::runtime_error ("Error occurred during set tensor value");
break;
}
lua_gettable (L, -2);
tensors_info.info[j - 1].type = gst_tensor_get_type (lua_tostring (L, -1));
if (tensors_info.info[j - 1].type == _NNS_END)
- throw std::invalid_argument ("Failed to parse `type`. Possibile types are " GST_TENSOR_TYPE_ALL);
+ throw std::invalid_argument ("Failed to parse `type`. Possible types are " GST_TENSOR_TYPE_ALL);
lua_pop (L, 1);
}
} else {
if (!g_file_test (prop->model_files[0], G_FILE_TEST_EXISTS)) {
nns_logi ("Given model file does not exist. Do script mode.");
- std::string script = g_strjoinv (",", (gchar **) prop->model_files);
- if (luaL_dostring (L, script.c_str ()) != 0) {
+ gchar *script = g_strjoinv (",", (gchar **) prop->model_files);
+ std::unique_ptr<gchar, decltype (&g_free)> script_ptr (
+ std::move (script), g_free);
+ if (luaL_dostring (L, script_ptr.get ()) != 0) {
throw std::invalid_argument (std::string ("Failed to run given Lua script. Error message: ") +
lua_tostring (L, -1));
}