Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
dynamic-graph-python
Commits
49bf3e82
Commit
49bf3e82
authored
Mar 15, 2014
by
Francois Keith
Browse files
Avoid memory leak.
parent
804f26f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/interpreter.cc
View file @
49bf3e82
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment