pivotal-jbarrett commented on a change in pull request #786:
URL: https://github.com/apache/geode-native/pull/786#discussion_r617711870



##########
File path: clicache/src/Cache.cpp
##########
@@ -55,6 +54,20 @@ namespace Apache
         m_nativeptr = gcnew native_shared_ptr<native::Cache>(nativeptr);
         m_pdxTypeRegistry = gcnew 
Apache::Geode::Client::Internal::PdxTypeRegistry(this);
         m_typeRegistry = gcnew Apache::Geode::Client::TypeRegistry(this);
+
+        m_disposedLock = gcnew Object();
+      }
+
+      Cache::~Cache() {
+        msclr::lock lockInstance(m_disposedLock);
+        if (!m_disposed) {
+          this->!Cache();

Review comment:
       We should be forcing invocation of `Close`, if it hasn't been called 
already, and eating any exceptions (maybe log but no exceptions should be 
thrown here) before deleting the `m_nativeptr`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to