Commit 877c2bfd authored by peastman's avatar peastman Committed by GitHub
Browse files

Merge pull request #1690 from peastman/leak

Fixed a memory leak
parents 0071c334 5447bb74
...@@ -127,6 +127,8 @@ void CpuPlatform::contextDestroyed(ContextImpl& context) const { ...@@ -127,6 +127,8 @@ void CpuPlatform::contextDestroyed(ContextImpl& context) const {
PlatformData* data = contextData[&context]; PlatformData* data = contextData[&context];
delete data; delete data;
contextData.erase(&context); contextData.erase(&context);
ReferencePlatform::PlatformData* refPlatformData = reinterpret_cast<ReferencePlatform::PlatformData*>(context.getPlatformData());
delete refPlatformData;
} }
CpuPlatform::PlatformData& CpuPlatform::getPlatformData(ContextImpl& context) { CpuPlatform::PlatformData& CpuPlatform::getPlatformData(ContextImpl& context) {
......
...@@ -56,7 +56,7 @@ public: ...@@ -56,7 +56,7 @@ public:
void contextDestroyed(ContextImpl& context) const; void contextDestroyed(ContextImpl& context) const;
}; };
class ReferencePlatform::PlatformData { class OPENMM_EXPORT ReferencePlatform::PlatformData {
public: public:
PlatformData(const System& system); PlatformData(const System& system);
~PlatformData(); ~PlatformData();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment