Skip to content
Snippets Groups Projects
Commit 49bf3e82 authored by Francois Keith's avatar Francois Keith
Browse files

Avoid memory leak.

parent 804f26f1
No related branches found
No related tags found
No related merge requests found
......@@ -230,13 +230,14 @@ PyObject* Interpreter::globals()
void Interpreter::runPythonFile( std::string filename )
{
PyObject* pymainContext = globals_;
PyRun_FileExFlags(fopen( filename.c_str(),"r" ), filename.c_str(),
PyObject* run = PyRun_FileExFlags(fopen( filename.c_str(),"r" ), filename.c_str(),
Py_file_input, pymainContext,pymainContext, true, NULL);
if (PyErr_Occurred())
{
std::cout << "Error occures..." << std::endl;
PyErr_Print();
}
Py_DecRef(run);
}
void Interpreter::runMain( void )
......
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