I can't find previous discussion (around 2018) for this with the search box.
COM classes (these with VFunction **vtbl;
field) inside ScintillaWin.cxx can be changed to C++ class similar to class BlobInline : public IDWriteInlineObject
in PlatWin.cxx. I think previous concern about GCC can't generate correct vtable (or class layout?) no longer applies.
reinterpret_cast<IXXX>
can be removed after implement them with C++ inheritance.Patch for the changes.
Why are the default virtual destructors needed? I expect they can be omitted following rule-of-zero with
final
added to the classes to show that they can't be derived from:virtual destructor copied from
class BlobInline
, for these in ScintillaWin.cxx both constructor and destructor can be omitted.Patch added
final
, removed unneeded constructor and destructor.There are other virtual destructors can also be removed,
rg virtual\s*~
.Many of these occurrences will be destroyed through deleting a derived class through a base class pointer. COM objects are deleted by calling
Release
(which calls delete from inside the class) and must never be deleted by other code.It may be worthwhile finding other cases for rule-of-zero but that can rely on implementation subtleties. There'll also be linter warnings when defining base classes without virtual destructors as COM -style interfaces are not understood by linters.
What about
class CaseConverter
in CaseConvert.cxx?OK [58cf34].
Also changed
CharacterIndexer
/DocumentIndexer
with [fc2f4c] as that is a simple case.Related
Commit: [58cf34]
Commit: [fc2f4c]
Committed with [72cb31] and [074546].
Related
Commit: [074546]
Commit: [72cb31]