We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f713a5d commit 51857e1Copy full SHA for 51857e1
obs-studio-server/source/util-osx-impl.mm
@@ -43,6 +43,9 @@
43
return;
44
45
while (true) {
46
+ if (!appRunning) {
47
+ break;
48
+ }
49
int ret = ::read(file_descriptor, buffer.data(), count);
50
if (ret > 0) {
51
bool appCrashed = *reinterpret_cast<bool *>(buffer.data());
@@ -107,10 +110,10 @@ @implementation UtilImplObj
107
110
data2:0];
108
111
[NSApp postEvent:event atStart:TRUE];
109
112
113
+ appRunning = false;
114
if (worker->joinable())
115
worker->join();
116
- appRunning = false;
117
});
118
}
119
obs-studio-server/source/util-osx-int.h
@@ -41,7 +41,7 @@ class UtilObjCInt {
41
42
private:
void *self;
- bool appRunning;
+ std::atomic<bool> appRunning;
std::thread *worker;
};
0 commit comments