http://d.puremagic.com/issues/show_bug.cgi?id=3566

           Summary: scoped class's member available after delete
           Product: D
           Version: 2.036
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: garick_home_...@rambler.ru


--- Comment #0 from garick <garick_home_...@rambler.ru> 2009-12-02 09:47:56 PST 
---
----------
code:

import std.stdio;

class A 
{ 
    int v_; 

    this( int v ) { v_ = v; }
    ~this() { writeln( "dtor called: ", v_ ); }
}

void f()
{
    scope A a = new A( 4 );
    delete a;
    if( a is null )
        writeln( ">>> a4 is null" );

    a.v_ = 500;
    writeln( "a.v_ == ", a.v_ );
}

void main()
{
    f(); 
    writeln( "end main" );
}

----------
output:

dtor called: 4
a.v_ == 500
end main

"a" must be null after delete..
is this behavior correct ?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to