public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/54351] ~unique_ptr() should not set __p to null Date: Wed, 22 Aug 2012 18:58:00 -0000 [thread overview] Message-ID: <bug-54351-4-4eo919bd00@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-54351-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54351 --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-08-22 18:58:22 UTC --- I'll test this change: @@ -169,7 +169,13 @@ #endif // Destructor. - ~unique_ptr() noexcept { reset(); } + ~unique_ptr() noexcept + { + auto& __ptr = std::get<0>(_M_t); + if (__ptr != pointer()) + get_deleter()(__ptr); + __ptr = pointer(); + } // Assignment. unique_ptr&
next prev parent reply other threads:[~2012-08-22 18:58 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-08-22 18:30 [Bug libstdc++/54351] New: " gromer at google dot com 2012-08-22 18:44 ` [Bug libstdc++/54351] " redi at gcc dot gnu.org 2012-08-22 18:47 ` redi at gcc dot gnu.org 2012-08-22 18:51 ` redi at gcc dot gnu.org 2012-08-22 18:58 ` redi at gcc dot gnu.org [this message] 2012-08-22 19:11 ` gromer at google dot com 2012-08-22 19:28 ` redi at gcc dot gnu.org 2012-08-22 19:49 ` [Bug libstdc++/54351] ~unique_ptr() should not set stored pointer " gromer at google dot com 2012-08-26 0:13 ` redi at gcc dot gnu.org 2012-08-26 0:30 ` redi at gcc dot gnu.org 2012-08-26 0:31 ` redi at gcc dot gnu.org 2012-12-18 21:59 ` gromer at google dot com 2015-05-26 23:45 ` rs2740 at gmail dot com 2015-05-27 8:01 ` redi at gcc dot gnu.org 2015-05-27 9:11 ` rs2740 at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-54351-4-4eo919bd00@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).