Skip to content

Commit

Permalink
Merge pull request #121 from jakob-stark/master
Browse files Browse the repository at this point in the history
Added virtual destructors to Handler classes.
  • Loading branch information
genivia-inc authored Feb 11, 2022
2 parents f3fc146 + 60c5a20 commit c468792
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion include/reflex/absmatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ class AbstractMatcher {
size_t num; ///< number of bytes shifted out so far, when buffer shifted
};
/// Event handler functor base class to invoke when the buffer contents are shifted out, e.g. for logging the data searched.
struct Handler { virtual void operator()(AbstractMatcher&, const char*, size_t, size_t) = 0; };
struct Handler {
virtual void operator()(AbstractMatcher&, const char*, size_t, size_t) = 0;
virtual ~Handler() {};
};
protected:
/// AbstractMatcher::Options for matcher engines.
struct Option {
Expand Down
5 changes: 4 additions & 1 deletion include/reflex/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ class Input {
static const file_encoding_type custom = 38; ///< custom code page
};
/// FILE* handler functor base class to handle FILE* errors and non-blocking FILE* reads
struct Handler { virtual int operator()() = 0; };
struct Handler {
virtual int operator()() = 0;
virtual ~Handler() {};
};
/// Stream buffer for reflex::Input, derived from std::streambuf.
class streambuf;
/// Stream buffer for reflex::Input to read DOS files, replaces CRLF by LF, derived from std::streambuf.
Expand Down

0 comments on commit c468792

Please sign in to comment.