Closed Bug 829975 Opened 7 years ago Closed 7 years ago

nsGIOService.cpp:252:1: warning: deleting object of polymorphic class type ‘nsGIOService’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

Categories

(Core :: Widget: Gtk, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

GCC 4.7.2 build warning:

{
toolkit/system/gnome/nsGIOService.cpp: In member function ‘virtual nsrefcnt nsGIOMimeApp::Release()’:

toolkit/system/gnome/nsGIOService.cpp:52:1: warning: deleting object of polymorphic class type ‘nsGIOMimeApp’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

toolkit/system/gnome/nsGIOService.cpp: In member function ‘virtual nsrefcnt GIOUTF8StringEnumerator::Release()’:

toolkit/system/gnome/nsGIOService.cpp:117:1: warning: deleting object of polymorphic class type ‘GIOUTF8StringEnumerator’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

toolkit/system/gnome/nsGIOService.cpp: In member function ‘virtual nsrefcnt nsGIOService::Release()’:

toolkit/system/gnome/nsGIOService.cpp:252:1: warning: deleting object of polymorphic class type ‘nsGIOService’ which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]
}

We just need to mark these classes as MOZ_FINAL, so the compiler knows there won't be any subclasses & they're fine without a virtual destructor.
Comment on attachment 701481 [details] [diff] [review]
fix

er, looks like karl's away for a few weeks.

This probably could just land without review, but I'll tag ehsan for a rubber-stamp for formality's sake, since I know he's familiar with this build warning. :)
Attachment #701481 - Flags: review?(karlt) → review?(ehsan)
Comment on attachment 701481 [details] [diff] [review]
fix

Review of attachment 701481 [details] [diff] [review]:
-----------------------------------------------------------------

A while ago I talked Boris into giving me blanket r+ on these types of patches, and hereby I transitively grant that to you too for all similar patches in the future.  :-)
Attachment #701481 - Flags: review?(ehsan) → review+
https://hg.mozilla.org/mozilla-central/rev/a2a89856f0a2
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.