1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47:09 +00:00

Make conky not crash on exit when using weather objects

This commit is contained in:
Pavel Labath 2010-11-13 16:36:43 +01:00
parent 758c2ed674
commit a1f4984a4e
3 changed files with 7 additions and 8 deletions

View File

@ -2522,6 +2522,11 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2) {
currentconffile = NULL; currentconffile = NULL;
free_and_zero(memtofree1); free_and_zero(memtofree1);
free_and_zero(memtofree2); free_and_zero(memtofree2);
#if defined BUILD_WEATHER_METAR || defined BUILD_WEATHER_XOAP
weather_free_info();
#endif
timed_thread::destroy_registered_threads(); timed_thread::destroy_registered_threads();
free_and_zero(info.cpu_usage); free_and_zero(info.cpu_usage);
@ -2564,9 +2569,6 @@ void clean_up_without_threads(void *memtofree1, void* memtofree2) {
#ifdef BUILD_RSS #ifdef BUILD_RSS
rss_free_info(); rss_free_info();
#endif #endif
#if defined BUILD_WEATHER_METAR || defined BUILD_WEATHER_XOAP
weather_free_info();
#endif
#ifdef BUILD_LUA #ifdef BUILD_LUA
llua_shutdown_hook(); llua_shutdown_hook();
llua_close(); llua_close();

View File

@ -102,7 +102,7 @@ timed_thread::timed_thread(const std::function<void(thread_handle &)> &start_rou
} }
/* destroy a timed thread. */ /* destroy a timed thread. */
void timed_thread::destroy(bool deregister_this) void timed_thread::destroy()
{ {
DBGP("destroying thread %ld", (long)p_timed_thread->thread.get()); DBGP("destroying thread %ld", (long)p_timed_thread->thread.get());
#ifdef DEBUG #ifdef DEBUG
@ -125,9 +125,6 @@ void timed_thread::destroy(bool deregister_this)
close(p_timed_thread->pipefd[1]); close(p_timed_thread->pipefd[1]);
running = false; running = false;
if (deregister_this) deregister(this);
} }
/* lock a timed thread for critical section activity */ /* lock a timed thread for critical section activity */

View File

@ -102,7 +102,7 @@ class timed_thread {
int test(int override_wait_time); int test(int override_wait_time);
/* destroy a timed thread */ /* destroy a timed thread */
void destroy(bool deregister_this = true); void destroy();
/* register a timed thread for destruction */ /* register a timed thread for destruction */
static int register_(const timed_thread_ptr &timed_thread); static int register_(const timed_thread_ptr &timed_thread);