Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f6b73c0 authored by Nian Sun's avatar Nian Sun Committed by Steve Kondik
Browse files

Fix memory leak in nativeDecodeFileDescriptor

Fix memory leak in nativeDecodeFileDescriptor:
SkFILEStream::kCallerRetains_Ownership is used to keep
life cycle of file in Java,so fclose is not called when
destruct SkFILEStream because ownership not belong to
native here, while when file is closed in Java, close
is called instead of fclose,that means buffer allocated
by malloc in fseek, when create SkFrontBufferedStream
with this filestream, will not be freed, because this
buffer will only be freedin fclose.
To fix this issue: duplicate this fd, and use
SkFILEStream::kCallerPasses_Ownership for SkFILEStream,
means Java and native manage file life cycle separately.
CRs-Fixed: 718738

Change-Id: I1c664551ab8d381db2e1f948a2207bc6fb7a11f9
parent ce8c41c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment