16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-19 03:09:18 +02:00

update lua api (details on wiki)

This commit is contained in:
milek7
2017-12-27 19:47:44 +01:00
parent 3a117dadb4
commit ccaf05e448
6 changed files with 43 additions and 12 deletions

View File

@@ -83,7 +83,7 @@ void TIsolated::DeleteAll() {
}
}
TIsolated * TIsolated::Find(std::string const &n)
TIsolated * TIsolated::Find(std::string const &n, bool create)
{ // znalezienie obiektu albo utworzenie nowego
TIsolated *p = pRoot;
while (p)
@@ -92,6 +92,8 @@ TIsolated * TIsolated::Find(std::string const &n)
return p;
p = p->pNext;
}
if (!create)
return nullptr;
pRoot = new TIsolated(n, pRoot); // BUG: source of a memory leak
return pRoot;
};