mirror of
https://github.com/reswitched/Mephisto.git
synced 2024-06-23 14:43:45 -04:00
Handle case where the handle got closed in messageAsync
This commit is contained in:
parent
39d1c65441
commit
799bc01cce
8
Ipc.cpp
8
Ipc.cpp
|
@ -36,8 +36,12 @@ void NPipe::messageAsync(shared_ptr<array<uint8_t, 0x100>> buf, function<void(ui
|
|||
acquire();
|
||||
client.wait([=] {
|
||||
auto obuf = client.pop();
|
||||
memcpy(buf->data(), obuf->data(), 0x100);
|
||||
cb(0, false); // XXX: HANDLE RETCODES AND CLOSE
|
||||
if (obuf != nullptr) {
|
||||
memcpy(buf->data(), obuf->data(), 0x100);
|
||||
cb(0, false); // XXX: HANDLE RETCODES
|
||||
} else {
|
||||
cb(0, true);
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
server.push(buf);
|
||||
|
|
Loading…
Reference in a new issue