[Issue 11311] New: [REG 2.064] Destructor not called on temporary with opIndex + opSlice

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 21 03:02:11 PDT 2013


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

           Summary: [REG 2.064] Destructor not called on temporary with
                    opIndex + opSlice
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at benjamin-thaut.de


--- Comment #0 from Benjamin Thaut <code at benjamin-thaut.de> 2013-10-21 03:02:07 PDT ---
Created an attachment (id=1272)
repro case

The attached repro case will print:

452fc0 => 1
452fc0 => 2
453fc0 => 1
452fc0 => 1
before bar
453fc0 => 2
453fc0 => 1
after bar
453fc0 => 0

on dmd 2.063 and before. On dmd 2.064 (latest git head) it will print:

1c02fc0 => 1
1c02fc0 => 2
1c03fc0 => 1
1c02fc0 => 1
before bar
1c03fc0 => 2
after bar
1c03fc0 => 1

This causes numerous memory leaks when using ref-counting for memory
management. It seems that the temproary object which is returned from getObj()
will never be destructed.

-- 
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