Bug 175826 - [GTK] Invalid virtual call to WebKitPopupMenu::cancelTracking() in destructor ~WebPopupMenuProxyGtk
Summary: [GTK] Invalid virtual call to WebKitPopupMenu::cancelTracking() in destructor...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 175829
  Show dependency treegraph
 
Reported: 2017-08-22 09:04 PDT by Adrian Perez
Modified: 2017-08-23 07:48 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-08-22 09:04:26 PDT
Virtual destructor ~WebPopupMenuProxyGtk calls cancelTracking(), which is
overriden by WebKitPopupMenu. This is a bug, because when the destructor
~WebPopupMenuProxyGtk runs, the destructor ~WebKitPopupMenu has already
been executed.

Issue reported by Clang's scan-build:

  http://people.igalia.com/aperez/scan-build/webkitgtk-2.17.91+tartan/report-a28fd3.html
Comment 1 Michael Catanzaro 2017-08-22 09:13:43 PDT
This does not seem easy to fix. Not sure what we can do here.
Comment 2 Ms2ger (he/him; ⌚ UTC+1/+2) 2017-08-23 00:10:53 PDT
I'm guessing overriding the ~WebKitPopupMenu destructor to call WebKitPopupMenu::cancelTracking() itself could work. WebPopupMenuProxyGtk::cancelTracking() would be called twice, but it looks idempotent.
Comment 3 Michael Catanzaro 2017-08-23 07:48:54 PDT
Let's follow the rule to not make any virtual function calls inside a constructor or destructor.