Jump to page: 1 2
Thread overview
[Issue 14246] RAII - proper destruction of partially constructed objects/structs
[Issue 14246] proper destruction of partially constructed objects/structs
Mar 04, 2015
Ali Cehreli
Aug 14, 2016
ZombineDev
Aug 14, 2016
ZombineDev
Aug 16, 2016
Sobirari Muhomori
May 19, 2017
Walter Bright
May 19, 2017
Walter Bright
May 19, 2017
Walter Bright
May 19, 2017
Walter Bright
May 20, 2017
Walter Bright
Jul 30, 2017
Moritz Maxeiner
Aug 07, 2017
ZombineDev
Sep 14, 2018
Walter Bright
March 04, 2015
https://issues.dlang.org/show_bug.cgi?id=14246

Ali Cehreli <acehreli@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acehreli@yahoo.com

--- Comment #1 from Ali Cehreli <acehreli@yahoo.com> ---
I think this is related:

  https://issues.dlang.org/show_bug.cgi?id=9704

Ali

--
August 14, 2016
https://issues.dlang.org/show_bug.cgi?id=14246

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com
           Severity|enhancement                 |major

--
August 14, 2016
https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #2 from ZombineDev <petar.p.kirov@gmail.com> ---
*** Issue 16388 has been marked as a duplicate of this issue. ***

--
August 14, 2016
https://issues.dlang.org/show_bug.cgi?id=14246

ZombineDev <petar.p.kirov@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry, preapproved,
                   |                            |safe, spec, wrong-code
                 CC|                            |petar.p.kirov@gmail.com
           Hardware|x86_64                      |All

--
August 16, 2016
https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #3 from Sobirari Muhomori <dfj1esp02@sneakemail.com> ---
How does it affect safety?

--
May 19, 2017
https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #4 from Andrei Alexandrescu <andrei@erdani.com> ---
Also loosely related: https://issues.dlang.org/show_bug.cgi?id=2590

--
May 19, 2017
https://issues.dlang.org/show_bug.cgi?id=14246

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
            Summary|proper destruction of       |RAII - proper destruction
                   |partially constructed       |of partially constructed
                   |objects/structs             |objects/structs

--
May 19, 2017
https://issues.dlang.org/show_bug.cgi?id=14246

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Linux                       |All

--
May 19, 2017
https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
Relevant discussion:

http://www.digitalmars.com/d/archives/digitalmars/D/What_is_going_on_here_257862.html

--
May 19, 2017
https://issues.dlang.org/show_bug.cgi?id=14246

--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> ---
Shachar Shemesh wrote this example:

import std.stdio;

struct A {
     int a = 3;

     this( int var ) { a += var; }

     ~this() { writeln("A down ", a); }
}

struct B {
     A a;

     this( int var ) {
         a = A(var+1);
         throw new Exception("An exception");
     }
}

void main() {
     try {
         auto b = B(2);
     } catch( Exception ex ) {
     }
}

I'd expect A's destructor to run, which does not seem to be the case.

--
« First   ‹ Prev
1 2