You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Steve Huston (JIRA)" <qp...@incubator.apache.org> on 2009/09/23 02:49:16 UTC

[jira] Assigned: (QPID-2076) C++ Broker assumes it can delete a pointer passed by message store plugin

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

Steve Huston reassigned QPID-2076:
----------------------------------

    Assignee: Steve Huston

> C++ Broker assumes it can delete a pointer passed by message store plugin
> -------------------------------------------------------------------------
>
>                 Key: QPID-2076
>                 URL: https://issues.apache.org/jira/browse/QPID-2076
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>    Affects Versions: 0.5
>            Reporter: Steve Huston
>            Assignee: Steve Huston
>         Attachments: QPID-2076.diff
>
>
> The 0.5 broker/message-store plugin arrangement has the plugin allocating an object derived from MessageStore and calling qpid::broker::Broker::setStore(MessageStore*) to allow the broker's normal operation to invoke methods through the pointer.
> The passed MessageStore pointer is stored in a std::auto_ptr and the Broker destruction deletes the store. This is not valid in all cases. Particularly, on Windows, different DLLs can have different heaps. Memory allocated in one DLL (such as a plugin) can often not be deleted from a different DLL or executable (such as the broker) - it looks like freeing memory which was never allocated.
> It also may be desireable in some cases to pass a pointer to qpid::broker::Broker::setStore() that is not dynamically allocated.
> I propose changing the store pointer in qpid::broker::Broker from std::auto_ptr to boost::shared_ptr - this will allow the constructing DLL to control if, when, and how the memory is released.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org