[ https://issues.apache.org/jira/browse/GEODE-4839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16448915#comment-16448915 ]
ASF subversion and git services commented on GEODE-4839: -------------------------------------------------------- Commit 0baf4112e8bf7921c7942b654887cee5c434e109 in geode-native's branch refs/heads/develop from Jacob Barrett [ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=0baf411 ] GEODE-4839: Use std::shared_ptr to hold persistent info object. (#285) > Fix type of persistenceInfo parameter on PersistenceManager methods > ------------------------------------------------------------------- > > Key: GEODE-4839 > URL: https://issues.apache.org/jira/browse/GEODE-4839 > Project: Geode > Issue Type: Improvement > Components: native client > Reporter: Blake Bender > Assignee: Jacob S. Barrett > Priority: Major > Labels: pull-request-available > Time Spent: 40m > Remaining Estimate: 0h > > Most/all of the methods on the PersistenceManager object take a parameter > called persistenceInfo with type 'void*&'. This presents a number of issues, > not the least of which is that, were the parameter actually used, it could > leak memory on every call. The callee is allowed to swap out the incoming > value for a newly allocated pointer during any call, and the caller has no > way to know when _or how_ to free the memory, since it's a void pointer. If > we change the type of persistenceInfo to std::shared_ptr<void>&, it will be > properly accounted for and deleted when no longer in use. -- This message was sent by Atlassian JIRA (v7.6.3#76005)