mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 00:32:11 +00:00
Bug 1767829 - Part 2: Give ScriptLoaderInterface a virtual destructor r=yulia
Classes with virtual methods should have a virtual destructor so deleting an object through a base class pointer works correctly. I think I got lint warnings about this when I added a new derived loader. Differential Revision: https://phabricator.services.mozilla.com/D145489
This commit is contained in:
parent
39651f8671
commit
1e506ccabd
@ -433,7 +433,7 @@ class ScriptLoader final : public JS::loader::ScriptLoaderInterface {
|
||||
nsIURI* GetBaseURI() const override;
|
||||
|
||||
private:
|
||||
virtual ~ScriptLoader();
|
||||
~ScriptLoader();
|
||||
|
||||
already_AddRefed<ScriptLoadRequest> CreateLoadRequest(
|
||||
ScriptKind aKind, nsIURI* aURI, nsIScriptElement* aElement,
|
||||
|
@ -57,6 +57,8 @@ class ScriptLoaderInterface : public nsISupports {
|
||||
using ScriptLoadRequestList = JS::loader::ScriptLoadRequestList;
|
||||
using ModuleLoadRequest = JS::loader::ModuleLoadRequest;
|
||||
|
||||
virtual ~ScriptLoaderInterface() = default;
|
||||
|
||||
// In some environments, we will need to default to a base URI
|
||||
virtual nsIURI* GetBaseURI() const = 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user