Skip to content

Commit

Permalink
sceFontLib: Don't call the callback if double-free. Should fix one pa…
Browse files Browse the repository at this point in the history
…rt of #6627
  • Loading branch information
hrydgard committed Mar 11, 2019
1 parent 335d257 commit 7865589
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Core/HLE/sceFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ class FontLib {
}
u32 args[2] = { params_.userDataAddr, (u32)handle_ };
// TODO: The return value of this is leaking.
__KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false);
if (handle_) { // Avoid calling free-callback on double-free
__KernelDirectMipsCall(params_.freeFuncAddr, 0, args, 2, false);
}
handle_ = 0;
fonts_.clear();
isfontopen_.clear();
Expand Down

0 comments on commit 7865589

Please sign in to comment.