library: Change init/deinit order to allow utils to depend on threading
This commit is contained in:
@@ -141,12 +141,13 @@ void library_deinit()
|
|||||||
{
|
{
|
||||||
lib->leak_detective->report(lib->leak_detective, detailed);
|
lib->leak_detective->report(lib->leak_detective, detailed);
|
||||||
lib->leak_detective->destroy(lib->leak_detective);
|
lib->leak_detective->destroy(lib->leak_detective);
|
||||||
|
lib->leak_detective = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
arrays_deinit();
|
|
||||||
threads_deinit();
|
|
||||||
backtrace_deinit();
|
backtrace_deinit();
|
||||||
|
arrays_deinit();
|
||||||
utils_deinit();
|
utils_deinit();
|
||||||
|
threads_deinit();
|
||||||
|
|
||||||
free((void*)this->public.ns);
|
free((void*)this->public.ns);
|
||||||
free(this);
|
free(this);
|
||||||
@@ -269,10 +270,10 @@ bool library_init(char *settings, const char *namespace)
|
|||||||
);
|
);
|
||||||
lib = &this->public;
|
lib = &this->public;
|
||||||
|
|
||||||
utils_init();
|
|
||||||
backtrace_init();
|
|
||||||
threads_init();
|
threads_init();
|
||||||
|
utils_init();
|
||||||
arrays_init();
|
arrays_init();
|
||||||
|
backtrace_init();
|
||||||
|
|
||||||
#ifdef LEAK_DETECTIVE
|
#ifdef LEAK_DETECTIVE
|
||||||
lib->leak_detective = leak_detective_create();
|
lib->leak_detective = leak_detective_create();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "test_runner.h"
|
#include "test_runner.h"
|
||||||
|
|
||||||
#include <library.h>
|
#include <library.h>
|
||||||
|
#include <threading/thread.h>
|
||||||
#include <plugins/plugin_feature.h>
|
#include <plugins/plugin_feature.h>
|
||||||
#include <collections/array.h>
|
#include <collections/array.h>
|
||||||
#include <utils/test.h>
|
#include <utils/test.h>
|
||||||
@@ -372,6 +373,7 @@ static void print_failures(array_t *failures)
|
|||||||
{
|
{
|
||||||
failure_t failure;
|
failure_t failure;
|
||||||
|
|
||||||
|
threads_init();
|
||||||
backtrace_init();
|
backtrace_init();
|
||||||
|
|
||||||
while (array_remove(failures, 0, &failure))
|
while (array_remove(failures, 0, &failure))
|
||||||
@@ -391,6 +393,7 @@ static void print_failures(array_t *failures)
|
|||||||
}
|
}
|
||||||
|
|
||||||
backtrace_deinit();
|
backtrace_deinit();
|
||||||
|
threads_deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user