mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
fix memory leak in debug build
This commit is contained in:
parent
fcc4ff93e0
commit
b645c284b5
@ -68,9 +68,8 @@ dispose(Thread* t, Thread* o, bool remove)
|
|||||||
expect(t, find(t->m->rootThread, o));
|
expect(t, find(t->m->rootThread, o));
|
||||||
|
|
||||||
unsigned c = count(t->m->rootThread, o);
|
unsigned c = count(t->m->rootThread, o);
|
||||||
Thread** threads = static_cast<Thread**>
|
RUNTIME_ARRAY(Thread*, threads, c);
|
||||||
(allocate(t->m->system, c * sizeof(Thread*)));
|
fill(t->m->rootThread, o, RUNTIME_ARRAY_BODY(threads));
|
||||||
fill(t->m->rootThread, o, threads);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (o->parent) {
|
if (o->parent) {
|
||||||
@ -115,7 +114,7 @@ dispose(Thread* t, Thread* o, bool remove)
|
|||||||
expect(t, not find(t->m->rootThread, o));
|
expect(t, not find(t->m->rootThread, o));
|
||||||
|
|
||||||
for (unsigned i = 0; i < c; ++i) {
|
for (unsigned i = 0; i < c; ++i) {
|
||||||
expect(t, find(t->m->rootThread, threads[i]));
|
expect(t, find(t->m->rootThread, RUNTIME_ARRAY_BODY(threads)[i]));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user