Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
421eb42a
Unverified
Commit
421eb42a
authored
Jan 13, 2026
by
Peter Eastman
Committed by
GitHub
Jan 13, 2026
Browse files
Fix memory error in PythonForce (#5182)
parent
e688b86e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
wrappers/python/src/swig_doxygen/swig_lib/python/pythonforce.i
...ers/python/src/swig_doxygen/swig_lib/python/pythonforce.i
+4
-0
No files found.
wrappers/python/src/swig_doxygen/swig_lib/python/pythonforce.i
View file @
421eb42a
...
@@ -12,6 +12,10 @@ namespace OpenMM {
...
@@ -12,6 +12,10 @@ namespace OpenMM {
class
ComputationWrapper
:
public
PythonForceComputation
{
class
ComputationWrapper
:
public
PythonForceComputation
{
public
:
public
:
ComputationWrapper
(
PyObject
*
computation
)
:
computation
(
computation
)
{
ComputationWrapper
(
PyObject
*
computation
)
:
computation
(
computation
)
{
Py_INCREF
(
computation
)
;
}
~
ComputationWrapper
()
{
Py_XDECREF
(
computation
)
;
}
}
void
compute
(
const
State&
state
,
double&
energy
,
void
*
forces
,
bool
forcesAreDouble
)
const
{
void
compute
(
const
State&
state
,
double&
energy
,
void
*
forces
,
bool
forcesAreDouble
)
const
{
PyGILState_STATE
gstate
;
PyGILState_STATE
gstate
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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