Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#1848 closed defect (fixed)

Clean up local reference handling

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

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

comment:1 Changed 6 years ago by rjeschke

  • Description modified (diff)

comment:2 Changed 6 years ago by rjeschke

  • Review URL(s) modified (diff)

comment:3 Changed 6 years ago by rjeschke

  • Status changed from new to reviewing

comment:4 Changed 6 years ago by rjeschke

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:5 Changed 6 years ago by rjeschke

  • Milestone set to Adblock-Plus-for-Android-1.3
Note: See TracTickets for help on using tickets.