From 316a659a67284ef375c2cb3b6b648e9518e5a4ea Mon Sep 17 00:00:00 2001 From: Chen Gong Date: Wed, 6 Mar 2019 02:00:40 +0800 Subject: [PATCH] fix(config/plugins.h): memory leak caused by non-virtual destructor Closes #259 --- src/rime/config/plugins.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rime/config/plugins.h b/src/rime/config/plugins.h index 7d965a9182..451b043bf6 100644 --- a/src/rime/config/plugins.h +++ b/src/rime/config/plugins.h @@ -17,6 +17,8 @@ class ConfigCompilerPlugin { typedef bool Review(ConfigCompiler* compiler, an resource); + virtual ~ConfigCompilerPlugin() = default; + virtual Review ReviewCompileOutput = 0; virtual Review ReviewLinkOutput = 0; }; @@ -57,7 +59,7 @@ struct ResourceType; class SaveOutputPlugin : public ConfigCompilerPlugin { public: SaveOutputPlugin(const ResourceType& output_resource); - ~SaveOutputPlugin(); + virtual ~SaveOutputPlugin(); Review ReviewCompileOutput; Review ReviewLinkOutput;