Merge pull request #17130 from unknownbrackets/leak-minor

Minor leak fix
This commit is contained in:
Henrik Rydgård 2023-03-18 16:58:58 +01:00 committed by GitHub
commit 99c11901f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 13 deletions

View file

@ -1853,6 +1853,11 @@ int __AtracSetContext(Atrac *atrac) {
return hleReportError(ME, ATRAC_ERROR_UNKNOWN_FORMAT, "unknown codec type in set context");
}
if (atrac->codecCtx_) {
// Shouldn't happen, but just in case.
atrac->ReleaseFFMPEGContext();
}
const AVCodec *codec = avcodec_find_decoder(ff_codec);
atrac->codecCtx_ = avcodec_alloc_context3(codec);

View file

@ -98,24 +98,18 @@ void TouchInputHandler::handleTouchEvent(HWND hWnd, UINT message, WPARAM wParam,
// from http://msdn.microsoft.com/en-us/library/ms812373.aspx
// disable the press and hold gesture for the given window
void TouchInputHandler::disablePressAndHold(HWND hWnd)
{
void TouchInputHandler::disablePressAndHold(HWND hWnd) {
// The atom identifier and Tablet PC atom
ATOM atomID = 0;
LPCTSTR tabletAtom = _T("MicrosoftTabletPenServiceProperty");
// Get the Tablet PC atom ID
atomID = GlobalAddAtom(tabletAtom);
ATOM atomID = GlobalAddAtom(tabletAtom);
// If getting the ID failed, return false
if (atomID == 0)
{
return;
if (atomID != 0) {
// Try to disable press and hold gesture by setting the window property.
SetProp(hWnd, tabletAtom, (HANDLE)1);
}
// Try to disable press and hold gesture by
// setting the window property, return the result
SetProp(hWnd, tabletAtom, (HANDLE)1);
GlobalDeleteAtom(atomID);
}
void TouchInputHandler::touchUp(int id, float x, float y){