From 73aab3ddb232646daf681d1e543ab7983a6f6a78 Mon Sep 17 00:00:00 2001 From: Mathieu Schroeter Date: Sat, 21 Jul 2018 17:44:29 +0200 Subject: [PATCH] Start the update thread only if cURL is available --- src/blupi.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/blupi.cxx b/src/blupi.cxx index a2b59b9..41d79fa 100644 --- a/src/blupi.cxx +++ b/src/blupi.cxx @@ -507,10 +507,10 @@ progressCallback ( } #endif /* USE_CURL */ +#ifdef USE_CURL static void CheckForUpdates () { -#ifdef USE_CURL url_data chunk; chunk.buffer = nullptr; /* we expect realloc(NULL, size) to work */ @@ -554,8 +554,8 @@ CheckForUpdates () free (chunk.buffer); curl_easy_cleanup (curl); -#endif /* USE_CURL */ } +#endif /* USE_CURL */ static int parseArgs (int argc, char * argv[], bool & exit) @@ -1029,7 +1029,10 @@ DoInit (int argc, char * argv[], bool & exit) g_pPixmap->LoadCursors (); g_pPixmap->ChangeSprite (SPRITE_WAIT); - // g_updateThread = new std::thread (CheckForUpdates); +#ifdef USE_CURL + g_updateThread = new std::thread (CheckForUpdates); +#endif /* USE_CURL */ + if (zoom != g_zoom) g_pEvent->SetWindowSize (g_zoom); g_pEvent->SetFullScreen (g_bFullScreen);