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
c775bd19
"platforms/cpu/vscode:/vscode.git/clone" did not exist on "eb2f74e01a4c2faf4abb9bae7aa47c471674213d"
Commit
c775bd19
authored
Nov 16, 2012
by
Peter Eastman
Browse files
Fixed error that required Context and Integrator to be deleted in a particular order
parent
cd6af26e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
2 deletions
+6
-2
openmmapi/include/openmm/Integrator.h
openmmapi/include/openmm/Integrator.h
+4
-1
openmmapi/src/Context.cpp
openmmapi/src/Context.cpp
+1
-0
openmmapi/src/ContextImpl.cpp
openmmapi/src/ContextImpl.cpp
+0
-1
platforms/cuda/src/CudaContext.cpp
platforms/cuda/src/CudaContext.cpp
+1
-0
No files found.
openmmapi/include/openmm/Integrator.h
View file @
c775bd19
...
...
@@ -54,6 +54,7 @@ class ContextImpl;
class
OPENMM_EXPORT
Integrator
{
public:
virtual
~
Integrator
()
{
cleanup
();
}
/**
* Get the size of each time step, in picoseconds. If this integrator uses variable time steps,
...
...
@@ -92,6 +93,7 @@ public:
*/
virtual
void
step
(
int
steps
)
=
0
;
protected:
friend
class
Context
;
friend
class
ContextImpl
;
/**
* This will be called by the Context when it is created. It informs the Integrator
...
...
@@ -103,7 +105,8 @@ protected:
* This will be called by the Context when it is destroyed to let the Integrator do any necessary
* cleanup. It will also get called again if the application calls reinitialize() on the Context.
*/
virtual
void
cleanup
()
=
0
;
virtual
void
cleanup
()
{
};
/**
* Get the names of all Kernels used by this Integrator.
*/
...
...
openmmapi/src/Context.cpp
View file @
c775bd19
...
...
@@ -216,6 +216,7 @@ void Context::reinitialize() {
System
&
system
=
impl
->
getSystem
();
Integrator
&
integrator
=
impl
->
getIntegrator
();
Platform
&
platform
=
impl
->
getPlatform
();
integrator
.
cleanup
();
delete
impl
;
impl
=
new
ContextImpl
(
*
this
,
system
,
integrator
,
&
platform
,
properties
);
}
...
...
openmmapi/src/ContextImpl.cpp
View file @
c775bd19
...
...
@@ -122,7 +122,6 @@ ContextImpl::~ContextImpl() {
updateStateDataKernel
=
Kernel
();
applyConstraintsKernel
=
Kernel
();
virtualSitesKernel
=
Kernel
();
integrator
.
cleanup
();
platform
->
contextDestroyed
(
*
this
);
}
...
...
platforms/cuda/src/CudaContext.cpp
View file @
c775bd19
...
...
@@ -255,6 +255,7 @@ CudaContext::~CudaContext() {
string
errorMessage
=
"Error deleting Context"
;
if
(
contextIsValid
)
CHECK_RESULT
(
cuCtxDestroy
(
context
));
contextIsValid
=
false
;
}
void
CudaContext
::
initialize
()
{
...
...
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