From 5de62bbe4dddc64895ddb17c4eb3572c3c9be248 Mon Sep 17 00:00:00 2001 From: Yong He Date: Mon, 19 Feb 2018 19:53:45 -0500 Subject: more to fixing memory leaks 1. reorder destruction order of several key classes to avoid using deleted IR objects when destroying Types 2. remove Session::canonicalTypes and make each Type own a RefPtr to the canonicalType, to allow types to be destroyed along with each IRModule it belongs to. --- source/slang/syntax-base-defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/syntax-base-defs.h') diff --git a/source/slang/syntax-base-defs.h b/source/slang/syntax-base-defs.h index 2eb130863..2c15f7215 100644 --- a/source/slang/syntax-base-defs.h +++ b/source/slang/syntax-base-defs.h @@ -119,7 +119,7 @@ public: protected: virtual bool EqualsImpl(Type * type) = 0; - virtual Type* CreateCanonicalType() = 0; + virtual RefPtr CreateCanonicalType() = 0; Type* canonicalType = nullptr; RefPtr canonicalTypeRefPtr; @@ -227,7 +227,7 @@ RAW( return rs; } typedef List, RefPtr>> WitnessTableLookupTable; -) + ) // The witness tables for each interface this actual type implements SYNTAX_FIELD(WitnessTableLookupTable, witnessTables) END_SYNTAX_CLASS() -- cgit v1.2.3