Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 3242a69

Browse files
Add virtual destructors to ByteStream* (#20417)
1 parent dbc97c5 commit 3242a69

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

shell/platform/common/cpp/client_wrapper/byte_buffer_streams.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ class ByteBufferStreamReader : public ByteStreamReader {
2323
explicit ByteBufferStreamReader(const uint8_t* bytes, size_t size)
2424
: bytes_(bytes), size_(size) {}
2525

26+
virtual ~ByteBufferStreamReader() = default;
27+
2628
// |ByteStreamReader|
2729
uint8_t ReadByte() override {
2830
if (location_ >= size_) {
@@ -69,6 +71,8 @@ class ByteBufferStreamWriter : public ByteStreamWriter {
6971
assert(buffer);
7072
}
7173

74+
virtual ~ByteBufferStreamWriter() = default;
75+
7276
// |ByteStreamWriter|
7377
void WriteByte(uint8_t byte) { bytes_->push_back(byte); }
7478

shell/platform/common/cpp/client_wrapper/include/flutter/byte_streams.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ namespace flutter {
1212
// An interface for a class that reads from a byte stream.
1313
class ByteStreamReader {
1414
public:
15+
explicit ByteStreamReader() = default;
16+
virtual ~ByteStreamReader() = default;
17+
1518
// Reads and returns the next byte from the stream.
1619
virtual uint8_t ReadByte() = 0;
1720

@@ -48,6 +51,9 @@ class ByteStreamReader {
4851
// An interface for a class that writes to a byte stream.
4952
class ByteStreamWriter {
5053
public:
54+
explicit ByteStreamWriter() = default;
55+
virtual ~ByteStreamWriter() = default;
56+
5157
// Writes |byte| to the stream.
5258
virtual void WriteByte(uint8_t byte) = 0;
5359

0 commit comments

Comments
 (0)