Thanks for your reply. Here is a code sample:
std::istringstream istr;
<* put data into istr here *>
boost::archive::text_iarchive ia(istr_);
Message* p_temp;
ia & p_temp;
mpBaseIncomingMessage = p_temp; // mpBaseIncomingMessage is of type (Message *)
mpIncomingMessage = static_cast(mpBaseIncomingMessage); // mpIncomingMessage is a pointer to a class derived from Message
mObjectCallbackMap.process(mpIncomingMessage->mEvent); // execute a callback for this event
delete mpIncomingMessage; // delete the allocated memory
We then see a crash on either the " mObjectCallbackMap.process..." line or the " delete mpIncomingMessage", but only when certain actions are taken by the system.
Any thoughts would be greatly appreciated.
Regards,
Adlai
-----Original Message-----
From: Boost-users [mailto:boost-users-bounces@lists.boost.org] On Behalf Of boost-users-request@lists.boost.org
Sent: Monday, February 04, 2013 1:11 PM
To: boost-users@lists.boost.org
Subject: Boost-users Digest, Vol 3349, Issue 6
Send Boost-users mailing list submissions to
boost-users@lists.boost.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.boost.org/mailman/listinfo.cgi/boost-users
or, via email, send a message with subject or body 'help' to
boost-users-request@lists.boost.org
You can reach the person managing the list at
boost-users-owner@lists.boost.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Boost-users digest..."
Today's Topics:
1. Re: Crediting the Work of Others (Bill Buklis)
2. How can I free memory allocated when deserializing with
boost::archive::text_iarchive (Adlai Shawareb)
3. Re: in IOS, thread_info object is being destructed before the
thread finishes executing (Nat Linden)
4. Re: Undirected version of dijkstra shortest path on directed
graph. (Jeremiah Willcock)
5. Re: Crediting the Work of Others (Algocoders)
6. Re: How can I free memory allocated when deserializing with
boost::archive::text_iarchive (Tim Moore)
7. [mpl::integral_c] Compiler Error with Visual Studio 2010
(Christian Henning)
8. Re: [mpl::integral_c] Compiler Error with Visual Studio 2010
(Nathan Crookston)
----------------------------------------------------------------------
Message: 1
Date: Mon, 04 Feb 2013 13:18:47 -0600
From: Bill Buklis
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] Crediting the Work of Others
Message-ID: <51100997.1050909@pbjzone.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 2/1/2013 1:33 PM, Algocoders wrote:
Dave Abrahams writes:
It has come to my attention that this book appears to use the work of
others without attribution. I'd like to give the authors a chance to
explain why that appearance is false. From what you can see in
Amazon's limited preview of the book, one can find numerous instances
of code lifted from Andrew Sutton's "origin" library.
Some of the data structures have been renamed or had the case changed.
Most of the duplication of Origin code comes in Chapter 7 in that
book. There appear to be no references to Origin in that chapter
(based on searching through the book in Amazon).
The IndirectlyCopyable text includes unsourced quotes directly from
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3351.pdf
without quotation, and the concepts* diagrams are taken from the same
document. Is there an attribution on the previous page that we can't
see from Amazon's limited preview?
Crediting the work of others have been done in the book as mentioned
in the links below:
Preface :
http://www.algocoders.com/sites/default/files/preface_foa_revised.pdf
Acknowledgement :
http://www/algocoders.com/sites/default/files/acknowledgement_foa.pdf
Table of Contents :
http://www.algocoders.com/sites/default/files/toc_foa_revised.pdf
Chapter 3 :
http://www.algocoders.com/sites/default/files/chapter3_foa.pdf
Chapter 11 :
http://www.algocoders.com/sites/default/files/chapter11_foa.pdf
We have avoided repetitive mention of original sources in respective
chapters to let not the content be littered with these details again.
Please let us know if we need to attribute in respective chapters too,
we would like to work on it.
Your feedback will be really helpful to guide us as a corrective measure.
Looking forward for suggestions,
Cheers,
Algocoders
Only the last link for Chapter 11 actually works and there aren't any acknowledgements presented in that pdf.
--
Bill
------------------------------
Message: 2
Date: Mon, 4 Feb 2013 19:46:54 +0000
From: Adlai Shawareb
To: "boost-users@lists.boost.org"
Subject: [Boost-users] How can I free memory allocated when
deserializing with boost::archive::text_iarchive
Message-ID:
<842DD0CD91745A48B9355924E2CF0BEA114FEF3D@VYTRONUS-SBS.vytronus.local>
Content-Type: text/plain; charset="us-ascii"
Hi,
Does anyone know how we can free memory that is dynamically allocated by boost::archive::text_iarchive when deserializing an archive?
We have tried using 'delete' and free() on the pointer when we finish with it, but it results in a crash.
How does Boost dynamically allocate memory, 'new', 'malloc', or other?
We tried a shared_ptr, but were getting compile errors related to the include files, and have not gone back to track that down. So if there is a simple way to free the memory that would be best for our application.
Thanks,
Adlai Shawareb
Vytronus, Inc.