Wednesday, 15 January 2014

c++ - Does a filter / StringSink allocated with new require a delete? -


Consider the code line:

  string source (cipher, true, new pkc scripter filter (rng, decryptter, new string sysink (plain text)); The filter has been designed using the   

filter and stringsync object using new , now I'm curious whether I want to remove those people I am liable 'I am sure how I will do this because I need pointers for these objects.

When I look at test projects, I can not get a delete, so I delete these objects automatically.

But since the documentation may be wrong, I think I am sure.

By looking at those sections, both of them have their code from a member_ptr Adds that are related to auto deletion. You should not remove them manually, just handle it to the library.


No comments:

Post a Comment