Rework for git.tesses.org, GC* is std::shared_ptr maybe will fix crash during exit
This commit is contained in:
@@ -212,15 +212,15 @@ void CrossLangCompiler(std::vector<std::string>& argv)
|
||||
|
||||
}
|
||||
|
||||
GC* gc=nullptr;
|
||||
GCList* ls=nullptr;
|
||||
std::shared_ptr<GC> gc;
|
||||
std::shared_ptr<GCList> ls;
|
||||
TRootEnvironment* env=nullptr;
|
||||
if(comptime != "none")
|
||||
{
|
||||
gc = new GC();
|
||||
std::shared_ptr<GC> gc= std::make_shared<GC>();
|
||||
gc->Start();
|
||||
ls = new GCList(gc);
|
||||
env = TRootEnvironment::Create(ls,TDictionary::Create(ls));
|
||||
ls = std::make_shared<GCList>(gc);
|
||||
env = TRootEnvironment::Create(*ls,TDictionary::Create(*ls));
|
||||
|
||||
if(comptime == "secure")
|
||||
{
|
||||
@@ -281,10 +281,5 @@ void CrossLangCompiler(std::vector<std::string>& argv)
|
||||
|
||||
gen.Save(strm);
|
||||
}
|
||||
if(gc != nullptr)
|
||||
{
|
||||
delete ls;
|
||||
delete gc;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user