mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-03 01:41:15 -03:00
Fix memory leaks at exit found in tests
This fixes all memory leaks found by compiling with clang++ -g -fsanitize=address and running the tests. Method: Ensure that memory is freed by the destructor of its respective container, either by storing objects directly instead of by pointer, or implementing the required destructor.
This commit is contained in:
committed by
ridiculousfish
parent
7accadc33f
commit
6495bd470d
@@ -2645,9 +2645,11 @@ static void test_universal()
|
||||
if (system("mkdir -p /tmp/fish_uvars_test/")) err(L"mkdir failed");
|
||||
|
||||
const int threads = 16;
|
||||
static int ctx[threads];
|
||||
for (int i=0; i < threads; i++)
|
||||
{
|
||||
iothread_perform(test_universal_helper, new int(i));
|
||||
ctx[i] = i;
|
||||
iothread_perform(test_universal_helper, &ctx[i]);
|
||||
}
|
||||
iothread_drain_all();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user