Skip to content

Commit

Permalink
Io: Don't confuse kernel object with meta handle.
Browse files Browse the repository at this point in the history
Make sure we never try to close an unrelated open file when destroying an
async open temporary file node.
  • Loading branch information
unknownbrackets committed Jun 6, 2021
1 parent 294f78d commit 9324a1c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Core/HLE/sceIo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,10 @@ static FileNode *__IoOpen(int &error, const char *filename, int flags, int mode)
error = 0;

FileNode *f = new FileNode();
SceUID id = kernelObjects.Create(f);
kernelObjects.Create(f);
f->handle = h;
f->fullpath = filename;
f->asyncResult = id;
f->asyncResult = h;
f->info = info;
f->openMode = access;
f->isTTY = isTTY;
Expand Down Expand Up @@ -2118,7 +2118,8 @@ static u32 sceIoOpenAsync(const char *filename, int flags, int mode) {
return hleLogError(SCEIO, error, "device not found");

f = new FileNode();
f->handle = kernelObjects.Create(f);
kernelObjects.Create(f);
f->handle = -1;
f->fullpath = filename;
f->closePending = true;
}
Expand Down

0 comments on commit 9324a1c

Please sign in to comment.