Skip to content

Commit

Permalink
fix crashes with Recompile shader on file change
Browse files Browse the repository at this point in the history
Without the timeout select seems to hang indefinitely.
Without the rfds initialization select never reported any changes.
  • Loading branch information
nhkode committed Jan 10, 2025
1 parent 780e967 commit 8062421
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/SHADERed/UI/CodeEditorUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,13 @@ namespace ed {
}
#elif defined(__linux__) || defined(__unix__)
fd_set rfds;
int eCount = select(notifyEngine + 1, &rfds, NULL, NULL, NULL);
FD_ZERO(&rfds);
FD_SET(notifyEngine, &rfds);
timeval timeout;
timeout.tv_sec = 0;
timeout.tv_usec = 100000;

int eCount = select(notifyEngine + 1, &rfds, NULL, NULL, &timeout);

if (eCount <= 0) continue;

Expand Down

0 comments on commit 8062421

Please sign in to comment.