Open Bowarc opened 3 weeks ago
so on windows the pipes are just normal file handles, and the File
API doesnt have an explicit way to close a file (other than dropping it). i guess i figured that i didnt need to do anything to accomplish this when i first implemented windows (oops). i can add a call to std::mem::drop
in the windows code, which should be explicit enough?
also, for the
if self.send(data, 2).is_ok() {} // ?
lines, i don't really know what's going on there. they're removed in dev so i assume they aren't important
i can add a call to std::mem::drop in the windows code, which should be explicit enough?
If the code is doing what's expected, no need to modify it, maybe a comment would clarify this for any future reader ?
That said, now that i look at it, the file handle is not dropped, you only drop the reference you created with self.socket.as_mut().ok_or(Error::NotConnected)?;
To actually drop the File
don't you need to .take
self.socket
and then drop it ?
Maybe im missing something
yea I think you're right, I didn't properly drop the file when I first wrote this lol. I'll update the code to properly drop the file
I maybe am missing something but it looks like the
.close
method inDiscordIpc
's implementation on windows do nothingWindows's implementation:
Unix's implementation
Has something been forgotten ?