Bug 3236 – Postblit called but no matching destructor

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
Windows
Creation time
2009-08-08T12:04:00Z
Last change time
2015-06-09T01:26:49Z
Keywords
wrong-code
Assigned to
nobody
Creator
bartosz

Attachments

IDFilenameSummaryContent-TypeSize
438bug.dTest case for incorrect reference countingapplication/octet-stream1801

Comments

Comment #0 by bartosz — 2009-08-08T12:04:27Z
Created attachment 438 Test case for incorrect reference counting RcName is a struct that defines postblit, this(this), in order to implement reference counting. When I store the result of a call and then return it: RcName rc = create(); return rc; I get the right reference count. But if I return directly: return create(); postblit is called (increasing ref count), but the destructor is not, so I end up with ref count that is too big
Comment #1 by bugzilla — 2009-09-03T13:43:53Z
Fixed dmd 2.032