warning C4265: 'js::BackgroundSweepTask' : class has virtual functions, but destructor is not virtual

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: jorendorff, Assigned: luke)

Tracking

Other Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

(Reporter)

Description

8 years ago
MikeM reports this MSVC warning:

warning C4265: 'js::BackgroundSweepTask' : class has virtual functions, but destructor is not virtual instances of this class may not be destructed correctly

I don't see an actual correctness bug here, but it looks like the style could stand to be tightened up a little bit. Luke agreed to take it. Low priority though of course it would be really nice to build warning-free on MSVC.
(Assignee)

Comment 1

8 years ago
Upon closer inspection, it seems like JSBackgroundThread definitely needs a virtual destructor: BackgroundSweepTasks are deleted via a JSBackgroundTask*.  This means, e.g., that BackgroundSweepTask::freeVector's destructor is not getting called.

So it seems there is only one concrete subclass of JSBackgroundTask.  Andreas, is the idea that more of these will be added over time?
(Assignee)

Comment 2

8 years ago
http://hg.mozilla.org/tracemonkey/rev/b0f49ebf6325
Whiteboard: fixed-in-tracemonkey

Comment 4

8 years ago
http://hg.mozilla.org/mozilla-central/rev/b0f49ebf6325
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.