summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 506d3e4c387..95ba2e0c583 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -35,17 +35,16 @@ ObjCMethodDecl *ObjCMethodDecl::Create(ASTContext &C,
isVariadic, isSynthesized, impControl);
}
-ObjCMethodDecl::~ObjCMethodDecl() {
- delete [] ParamInfo;
-}
-
void ObjCMethodDecl::Destroy(ASTContext& C) {
if (Body) Body->Destroy(C);
if (SelfDecl) SelfDecl->Destroy(C);
for (param_iterator I=param_begin(), E=param_end(); I!=E; ++I)
if (*I) (*I)->Destroy(C);
-
+
+ delete [] ParamInfo;
+ ParamInfo = 0;
+
Decl::Destroy(C);
}
@@ -102,11 +101,15 @@ ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C, DeclContext *DC,
return new (C) ObjCProtocolDecl(DC, L, Id);
}
-ObjCProtocolDecl::~ObjCProtocolDecl() {
+void ObjCProtocolDecl::Destroy(ASTContext &C) {
delete [] PropertyDecl;
+ PropertyDecl = 0;
+ ObjCContainerDecl::Destroy(C);
}
+
+
ObjCClassDecl *ObjCClassDecl::Create(ASTContext &C, DeclContext *DC,
SourceLocation L,
ObjCInterfaceDecl **Elts, unsigned nElts) {
OpenPOWER on IntegriCloud