Opened 5 years ago

Last modified 5 years ago

#1848 closed defect

Clean up local reference handling — at Initial Version

Reported by: rjeschke Assignee: rjeschke
Priority: P1 Milestone: Adblock-Plus-for-Android-1.3
Module: Adblock-Plus-for-Android Keywords:
Cc: Blocked By:
Blocking: Platform: Android
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):


With Android 5.x a new type of errors is popping up: local reference table overflows.

This bug is caused by holding JNI created Java references for too long. It's strange that this didn't cause any errors before 5.x, but now we have to deal with it.

The solution for this is pretty simple (but time consuming):

We will need to go through all JNI methods and dispose local references as soon as we don't need them anymore. To reduce code clutter we should implement this using a Push-/PopLocalFrame RAII wrapper for methods that do not return or pass objects, and RAII wrappers for single references in cases where we need a finer grained control over when to dispose stuff.

Change History (0)

Note: See TracTickets for help on using tickets.