Skip to content
Snippets Groups Projects
Commit 79c4472e authored by florent's avatar florent
Browse files

Fix a memory bug

    * src/entity-py.cc: change std::string in char*.
parent a4968134
No related branches found
No related tags found
No related merge requests found
......@@ -183,7 +183,7 @@ namespace dynamicgraph {
{
PyObject* object = NULL;
PyObject* argTuple = NULL;
std::string commandName;
char* commandName = NULL;
void* pointer = NULL;
if (!PyArg_ParseTuple(args, "OsO", &object, &commandName, &argTuple)) {
......@@ -208,13 +208,13 @@ namespace dynamicgraph {
std::map<const std::string, Command*> commandMap =
entity->getNewStyleCommandMap();
if (commandMap.count(commandName) != 1) {
std::string msg = "command " + commandName +
if (commandMap.count(std::string(commandName)) != 1) {
std::string msg = "command " + std::string(commandName) +
" is not referenced in Entity " + entity->getName();
PyErr_SetString(error, msg.c_str());
return NULL;
}
Command* command = commandMap[commandName];
Command* command = commandMap[std::string(commandName)];
// Check that tuple size is equal to command number of arguments
const std::vector<Value::Type> typeVector = command->valueTypes();
if (size != typeVector.size()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment