You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Jacob S. Barrett (JIRA)" <ji...@apache.org> on 2018/04/23 21:55:00 UTC

[jira] [Resolved] (GEODE-4839) Fix type of persistenceInfo parameter on PersistenceManager methods

     [ https://issues.apache.org/jira/browse/GEODE-4839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacob S. Barrett resolved GEODE-4839.
-------------------------------------
    Resolution: Fixed

> 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)