Opened 2 years ago

Closed 2 years ago

#6305 closed change (fixed)

Do not nullify storage on engine disposed

Reported by: asmirnov Assignee:
Priority: P3 Milestone:
Module: Libadblockplus-Android Keywords:
Cc: Blocked By:
Blocking: Platform: Android
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):



AdblockHelper acts as Facade for AdblockEngine and AdblockSettingStorage.

Typical lifecycle is:
1) init() (can be done once)
2) retain() (can be done multiple times by different clients)
3) use AdblockEngine instance returned with getEngine()
4) release() (can be done multiple times by different clients)

However when the last client calls release() AdblockProvider actually releases AdblockEngine and storage is released too:


In complex lifecycle the client can call retain() after it's actually released and it will try to access already nullified storage:

It should be consistent - both create/release in retain()/release() or keep single instance throughout all helper lifetime and do not release it on engine release.

What to change

Do not release storage on engine released or create it everytime on retain().

Change History (3)

comment:1 Changed 2 years ago by asmirnov

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 2 years ago by asmirnov

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.