[Issue 3516] New: Destructor not called on temporaries

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 16 14:32:40 PST 2009


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

           Summary: Destructor not called on temporaries
           Product: D
           Version: 2.032
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bartosz at relisoft.com


--- Comment #0 from Bartosz Milewski <bartosz at relisoft.com> 2009-11-16 14:32:39 PST ---
Created an attachment (id=497)
Reference counting doesn't work when temporaries created

Function f returns (by value) a struct that has a destructor. If I explicitly
assign the result of f to a temporary, that temporary is destroyed at the end
of scope. If I don't assign it, the hidden temporary is not destroyed. In the
attached example this screws up reference counting.

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


More information about the Digitalmars-d-bugs mailing list