ContextHub: Avoid reference leaks
The ContextHub HAL was leaking references in passOnOsResponse. An
example of this is when a sensor hub reset occurs. If many of these
resets happen, the local reference pool is exhausted and a crash
in the HAL occurs.
Bug: 30706325
Change-Id: Ica5328137a7033f512d7fb1ccf6fa138eab55091
(cherry picked from commit 52dda59896)
This commit is contained in:
committed by
Brian Duddie
parent
d90b69ffb1
commit
c35104535c
@@ -603,6 +603,8 @@ static void passOnOsResponse(uint32_t hubHandle, uint32_t msgType,
|
||||
env->CallIntMethod(db.jniInfo.jContextHubService,
|
||||
db.jniInfo.contextHubServiceMsgReceiptCallback,
|
||||
jheader, jmsg);
|
||||
env->DeleteLocalRef(jmsg);
|
||||
env->DeleteLocalRef(jheader);
|
||||
|
||||
delete[] msg;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user