GC::emptyWeakRef can get collected

VERIFIED FIXED

Status

VERIFIED FIXED
10 years ago
9 years ago

People

(Reporter: stejohns, Assigned: stejohns)

Tracking

Details

Attachments

(1 attachment)

(Assignee)

Description

10 years ago
emptyWeakRef needs to live forever, but is allocated from managed memory and can get collected under unusual circumstances. It should be allocated from unmanaged memory instead.
(Assignee)

Comment 1

10 years ago
Created attachment 344338 [details] [diff] [review]
Patch

Added a GCRoot to GC to keep GC::emptyWeakRef around forever, as it needs to be.

Also removed two unnecessary explicit calls to WB in Traits.cpp (the fields in question are DWB so explicit call is redundant)
Attachment #344338 - Flags: review?(treilly)

Comment 2

10 years ago
Comment on attachment 344338 [details] [diff] [review]
Patch

don't use new just make the GCRoot part of the GC
(Assignee)

Comment 3

10 years ago
I tried that, but apparently the order of initialization isn't guaranteed, I had the root being initialized before m_roots was, which caused crashes.

Comment 4

10 years ago
Doesn't C++ guarantee declaration order == initialization order?  Anyway's using new's fine I guess.
(Assignee)

Comment 5

10 years ago
I thought it did, but empirically it doesn't seem to be so in certain Flash configurations. (awaiting a review+ if this is ok with you)

Updated

10 years ago
Attachment #344338 - Flags: review?(treilly) → review+
(Assignee)

Comment 6

10 years ago
pushed to redux as changeset:   1024:d4df732ef925
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → FIXED

Comment 7

9 years ago
Resolved fixed engineering / work item that has been pushed.  Setting status to verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.