This differential implements DraftStoreOperations C++ utility to convert drafts related redux actions payloads to DatabaseQueryExecutor calls.
Details
- Reviewers
tomek atul • jon - Commits
- rCOMMee8553ccdb3d: Implement DraftStoreOperations C++ utility
This differential only introduces C++ header file, so it is not possible to create test plan.
Diff Detail
- Repository
- rCOMM Comm
- Branch
- marcin/eng-2137
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h | ||
---|---|---|
7 | Why do we need a virtual destructor? |
native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h | ||
---|---|---|
7 | I think we should always have a virtual destructor for anything that gets subtyped. Note that we are currently seeing compiler warnings in the native build because MessageSpec does not specify a virtual destructor |
native/cpp/CommonCpp/NativeModules/DraftStoreOperations.h | ||
---|---|---|
7 | In CommCoreModule we will (introduced in further diffs in this stack) have function that returns object of type std::vector<std::unique_ptr<DraftStoreOperationBase>>. When it gets destroyed, destructor of each element in this vector will be called and without destructor being virtual only memory allocated for DraftStoreOperationBase would be deleted.
Without any doubt it was a mistake not to introduce it. I will create Linear task to introduce virtual destructors for any C++ class in the codebase that is meant to be derived from. |
I will create Linear task to introduce virtual destructors for any C++ class in the codebase that is meant to be derived from.
Thank you @marcin!! Please link before landing :)
Issue to track virtual destructors: https://linear.app/comm/issue/ENG-2329/make-sure-all-virtual-classes-in-c-code-base-have-virtual-destructor