Using "new" with Poco library methods <p>Using the Poco libraries, if I'm doing something like this:</p> <pre><code>MailMessage mailMessage; mailMessage.addPart("", new FilePartSource("/path/icon.png", "image/png"), Poco::Net::MailMessage::CONTENT_ATTACHMENT, Poco::Net::MailMessage::ENCODING_BASE64); </code></pre> <p>Do I need to worry about deleting the "newed" FilePartSource<br> that's sent to the addPart method/function in MailMessage?</p> <p><a href="http://stackoverflow.com/questions/24773000/upload-a-file-using-poco-ssl-connection-unexpectedly-closed-exception">Upload a file using POCO - SSL Connection Unexpectedly Closed Exception</a></p> <p>I've noticed in some examples where "new" is tossed-in places that I wouldn't call typical.</p> <p>Line 65-66: new StringPartSource <a href="https://github.com/pocoproject/poco/blob/develop/Net/samples/Mail/src/Mail.cpp" rel="nofollow">https://github.com/pocoproject/poco/blob/develop/Net/samples/Mail/src/Mail.cpp</a></p> <p>Line 88: new Context <a href="https://github.com/pocoproject/poco/blob/develop/NetSSL_OpenSSL/samples/Mail/src/Mail.cpp" rel="nofollow">https://github.com/pocoproject/poco/blob/develop/NetSSL_OpenSSL/samples/Mail/src/Mail.cpp</a></p>