[ 
https://issues.apache.org/jira/browse/GEODE-9171?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326710#comment-17326710
 ] 

ASF GitHub Bot commented on GEODE-9171:
---------------------------------------

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]


> Threads Aren't Being Terminated
> -------------------------------
>
>                 Key: GEODE-9171
>                 URL: https://issues.apache.org/jira/browse/GEODE-9171
>             Project: Geode
>          Issue Type: Bug
>          Components: native client
>            Reporter: Michael Martell
>            Priority: Major
>              Labels: pull-request-available
>
> For .NET applications using the native client, threads aren't being 
> terminated when the native client Cache is closed. This causes a huge leak of 
> memory which can cause long running apps to crash.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to