Closed Bug 562470 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: JavaScript Engine, defect)

Other Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jorendorff, Assigned: luke)

Details

(Whiteboard: fixed-in-tracemonkey)

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.
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?
http://hg.mozilla.org/tracemonkey/rev/b0f49ebf6325
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/b0f49ebf6325
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.