mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Stop leaking memory from Module and FileUnit.
Also, disallow creating Modules and FileUnits on the stack. They must always live as long as the ASTContext. <rdar://problem/15596964> Swift SVN r13671
This commit is contained in:
@@ -218,7 +218,7 @@ Module *SerializedModuleLoader::loadModule(SourceLoc importLoc,
|
||||
|
||||
assert(inputFile);
|
||||
|
||||
auto M = new (Ctx) Module(moduleID.first, Ctx);
|
||||
auto M = Module::create(moduleID.first, Ctx);
|
||||
Ctx.LoadedModules[moduleID.first.str()] = M;
|
||||
|
||||
(void)loadAST(*M, moduleID.second, std::move(inputFile));
|
||||
|
||||
Reference in New Issue
Block a user