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
66616acc
Unverified
Commit
66616acc
authored
Mar 04, 2024
by
Peter Eastman
Committed by
GitHub
Mar 04, 2024
Browse files
Fixed memory leak (#4461)
parent
6c6bc628
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
openmmapi/src/ATMForceImpl.cpp
openmmapi/src/ATMForceImpl.cpp
+7
-2
No files found.
openmmapi/src/ATMForceImpl.cpp
View file @
66616acc
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
* https://github.com/Gallicchio-Lab/openmm-atmmetaforce-plugin *
* https://github.com/Gallicchio-Lab/openmm-atmmetaforce-plugin *
* with support from the National Science Foundation CAREER 1750511 *
* with support from the National Science Foundation CAREER 1750511 *
* *
* *
* Portions copyright (c) 2021-202
3
by the Authors *
* Portions copyright (c) 2021-202
4
by the Authors *
* Authors: Emilio Gallicchio *
* Authors: Emilio Gallicchio *
* Contributors: Peter Eastman *
* Contributors: Peter Eastman *
* *
* *
...
@@ -56,7 +56,8 @@
...
@@ -56,7 +56,8 @@
using
namespace
OpenMM
;
using
namespace
OpenMM
;
using
namespace
std
;
using
namespace
std
;
ATMForceImpl
::
ATMForceImpl
(
const
ATMForce
&
owner
)
:
owner
(
owner
),
innerIntegrator0
(
1.0
),
innerIntegrator1
(
1.0
)
{
ATMForceImpl
::
ATMForceImpl
(
const
ATMForce
&
owner
)
:
owner
(
owner
),
innerIntegrator0
(
1.0
),
innerIntegrator1
(
1.0
),
innerContext0
(
NULL
),
innerContext1
(
NULL
)
{
Lepton
::
ParsedExpression
expr
=
Lepton
::
Parser
::
parse
(
owner
.
getEnergyFunction
()).
optimize
();
Lepton
::
ParsedExpression
expr
=
Lepton
::
Parser
::
parse
(
owner
.
getEnergyFunction
()).
optimize
();
energyExpression
=
expr
.
createCompiledExpression
();
energyExpression
=
expr
.
createCompiledExpression
();
u0DerivExpression
=
expr
.
differentiate
(
"u0"
).
createCompiledExpression
();
u0DerivExpression
=
expr
.
differentiate
(
"u0"
).
createCompiledExpression
();
...
@@ -81,6 +82,10 @@ ATMForceImpl::ATMForceImpl(const ATMForce& owner) : owner(owner), innerIntegrato
...
@@ -81,6 +82,10 @@ ATMForceImpl::ATMForceImpl(const ATMForce& owner) : owner(owner), innerIntegrato
}
}
ATMForceImpl
::~
ATMForceImpl
()
{
ATMForceImpl
::~
ATMForceImpl
()
{
if
(
innerContext0
!=
NULL
)
delete
innerContext0
;
if
(
innerContext1
!=
NULL
)
delete
innerContext1
;
}
}
void
ATMForceImpl
::
copySystem
(
ContextImpl
&
context
,
const
OpenMM
::
System
&
system
,
OpenMM
::
System
&
innerSystem
)
{
void
ATMForceImpl
::
copySystem
(
ContextImpl
&
context
,
const
OpenMM
::
System
&
system
,
OpenMM
::
System
&
innerSystem
)
{
...
...
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