Opened 5 years ago

Last modified 5 years ago

#1848 closed defect

Clean up local reference handling — at Version 1

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):

http://codereview.adblockplus.org/4761138508070912/

Description (last modified by rjeschke)

With Android 5.x a new type of errors is popping up: local reference table overflows. This error always results in an application crash.

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 (1)

comment:1 Changed 5 years ago by rjeschke

  • Description modified (diff)
Note: See TracTickets for help on using tickets.