Skip to content

Commit

Permalink
fix(cli): fix watcher crash
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Aug 8, 2024
1 parent 3ecdbef commit c05a259
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions src/cli/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ Process* buildAfterScriptProcess = nullptr;
FileSystemWatcher* sourcesWatcher = nullptr;
Thread* sourcesWatcherSupportThread = nullptr;

Mutex signalHandlerMutex;

Path targetPath;
String settingsSource = "";
Map settings;
Expand All @@ -85,16 +83,8 @@ bool flagVerboseMode = true;
bool flagQuietMode = false;
Map defaultTemplateAttrs;

#if defined(__APPLE__)
std::atomic<bool> checkLogStore = true;
static dispatch_queue_t queue = dispatch_queue_create(
"socket.runtime.cli.queue",
dispatch_queue_attr_make_with_qos_class(
DISPATCH_QUEUE_CONCURRENT,
QOS_CLASS_USER_INITIATED,
-1
)
);
#if SOCKET_RUNTIME_PLATFORM_APPLE
Atomic<bool> checkLogStore = true;
#endif

void log (const String s) {
Expand Down Expand Up @@ -774,8 +764,6 @@ void signalHandler (int signum) {
}
#endif

Lock lock(signalHandlerMutex);

#if !SOCKET_RUNTIME_PLATFORM_WINDOWS
if (appPid > 0) {
kill(appPid, signum);
Expand All @@ -789,12 +777,6 @@ void signalHandler (int signum) {

appPid = 0;

if (sourcesWatcher != nullptr) {
sourcesWatcher->stop();
delete sourcesWatcher;
sourcesWatcher = nullptr;
}

if (sourcesWatcherSupportThread != nullptr) {
if (sourcesWatcherSupportThread->joinable()) {
sourcesWatcherSupportThread->join();
Expand Down

0 comments on commit c05a259

Please sign in to comment.