Skip to content

Commit d3f673d

Browse files
committed
Init: remove separate thread of displayserver and qt/gtk stuff detection
These threads are detached. If the main thread exits before the sub threads end, fastfetch may crash in various ways. It barely benefits performance. `hyperfine` shows completely no difference between `--thread` enabled and disabled. Let's get rid of it.
1 parent b99f444 commit d3f673d

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/common/init.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,29 +51,6 @@ void ffInitInstance(void)
5151
defaultConfig();
5252
}
5353

54-
#if defined(FF_HAVE_THREADS) && !(defined(__APPLE__) || defined(_WIN32) || defined(__ANDROID__))
55-
56-
#include "detection/gtk_qt/gtk_qt.h"
57-
58-
#define FF_START_DETECTION_THREADS
59-
60-
FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(ffConnectDisplayServer)
61-
FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(ffDetectQt)
62-
FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(ffDetectGTK2)
63-
FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(ffDetectGTK3)
64-
FF_THREAD_ENTRY_DECL_WRAPPER_NOPARAM(ffDetectGTK4)
65-
66-
void startDetectionThreads(void)
67-
{
68-
ffThreadDetach(ffThreadCreate(ffConnectDisplayServerThreadMain, NULL));
69-
ffThreadDetach(ffThreadCreate(ffDetectQtThreadMain, NULL));
70-
ffThreadDetach(ffThreadCreate(ffDetectGTK2ThreadMain, NULL));
71-
ffThreadDetach(ffThreadCreate(ffDetectGTK3ThreadMain, NULL));
72-
ffThreadDetach(ffThreadCreate(ffDetectGTK4ThreadMain, NULL));
73-
}
74-
75-
#endif //FF_HAVE_THREADS
76-
7754
static volatile bool ffDisableLinewrap = true;
7855
static volatile bool ffHideCursor = true;
7956

0 commit comments

Comments
 (0)