Kaydet (Commit) 996b6fc9 authored tarafından Luboš Luňák's avatar Luboš Luňák

don't explicitly delete PPCallbacks-based compiler plugin actions

If the class is based on PPCallbacks too, Clang internals will delete
the instance.

Change-Id: I6dd83d800e6cca17eb0b5de23c8994f11c087fd5
üst 68c314fc
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <clang/Frontend/CompilerInstance.h> #include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/FrontendPluginRegistry.h> #include <clang/Frontend/FrontendPluginRegistry.h>
#include <clang/Lex/PPCallbacks.h>
#include <stdio.h> #include <stdio.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
...@@ -65,7 +66,11 @@ PluginHandler::~PluginHandler() ...@@ -65,7 +66,11 @@ PluginHandler::~PluginHandler()
i < pluginCount; i < pluginCount;
++i ) ++i )
if( plugins[ i ].object != NULL ) if( plugins[ i ].object != NULL )
delete plugins[ i ].object; {
// PPCallbacks is owned by preprocessor object, don't delete those
if( dynamic_cast< PPCallbacks* >( plugins[ i ].object ) == NULL )
delete plugins[ i ].object;
}
} }
void PluginHandler::handleOption( const string& option ) void PluginHandler::handleOption( const string& option )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment