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
ce3f7427
Commit
ce3f7427
authored
Aug 19, 2009
by
Michael Sherman
Browse files
Fix memory leak in C examples.
parent
aac28a18
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
examples/HelloArgonInC.c
examples/HelloArgonInC.c
+3
-1
examples/HelloSodiumChlorideInC.c
examples/HelloSodiumChlorideInC.c
+3
-1
No files found.
examples/HelloArgonInC.c
View file @
ce3f7427
...
...
@@ -26,11 +26,13 @@ void simulateArgon()
OpenMM_Platform
*
platform
;
OpenMM_NonbondedForce
*
nonbond
;
OpenMM_Vec3Array
*
initPosInNm
;
OpenMM_StringArray
*
pluginList
;
int
a
,
frameNum
;
/* Load any shared libraries containing GPU implementations. */
OpenMM_Platform_loadPluginsFromDirectory
(
pluginList
=
OpenMM_Platform_loadPluginsFromDirectory
(
OpenMM_Platform_getDefaultPluginsDirectory
());
OpenMM_StringArray_destroy
(
pluginList
);
/* Create a system with nonbonded forces. System takes ownership
of Force; don't destroy it yourself. */
...
...
examples/HelloSodiumChlorideInC.c
View file @
ce3f7427
...
...
@@ -197,14 +197,16 @@ myInitializeOpenMM( const MyAtomInfo atoms[],
MyOpenMMData
*
omm
=
(
MyOpenMMData
*
)
malloc
(
sizeof
(
struct
MyOpenMMData_s
));
/* These are temporary OpenMM objects used and discarded here. */
OpenMM_Vec3Array
*
initialPosInNm
;
OpenMM_StringArray
*
pluginList
;
OpenMM_NonbondedForce
*
nonbond
;
OpenMM_GBSAOBCForce
*
gbsa
;
OpenMM_Platform
*
platform
;
int
n
;
/* Load all available OpenMM plugins from their default location. */
OpenMM_Platform_loadPluginsFromDirectory
pluginList
=
OpenMM_Platform_loadPluginsFromDirectory
(
OpenMM_Platform_getDefaultPluginsDirectory
());
OpenMM_StringArray_destroy
(
pluginList
);
/* Create a System and Force objects within the System. Retain a reference
* to each force object so we can fill in the forces. Note: the OpenMM
...
...
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