From 0a2f26fef9ace74f1a8d8e85ba8b1d951588387d Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Sat, 23 Nov 2024 23:12:37 +0100 Subject: [PATCH] Fix parcel recycling when no response from bridge In case that there is no response from bridge, a second try of sending binder will cause the (unowned) parcels to be recycled twice. --- .../src/main/java/org/lsposed/lspd/service/BridgeService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daemon/src/main/java/org/lsposed/lspd/service/BridgeService.java b/daemon/src/main/java/org/lsposed/lspd/service/BridgeService.java index 8dc68741..a0af8c84 100644 --- a/daemon/src/main/java/org/lsposed/lspd/service/BridgeService.java +++ b/daemon/src/main/java/org/lsposed/lspd/service/BridgeService.java @@ -126,11 +126,11 @@ public class BridgeService { return; } - Parcel data = Parcel.obtain(); - Parcel reply = Parcel.obtain(); boolean res = false; // try at most three times for (int i = 0; i < 3; i++) { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); try { data.writeInterfaceToken(DESCRIPTOR); data.writeInt(ACTION.ACTION_SEND_BINDER.ordinal());