Opened on 12/19/2014 at 08:06:28 PM

Closed on 01/08/2015 at 04:03:05 PM

#1724 closed change (fixed)

Messaging on Safari is prone to memory leaks

Reported by: trev Assignee: sebastian
Priority: P2 Milestone: Adblock-Plus-1.8.10-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: Blocked By:
Blocking: Platform: Safari
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/6751260996796416

Description

Background

Our abstraction layer implements a way to respond to messages. While on Chrome this is a platform feature, on Safari we had to implement it ourselves. And it has the same issue that the Chrome implementation originally had: if the sender expects an answer but the receiver of the message doesn't send one, then the sender has no way of knowing it. So the callback for the answer will stay around waiting forever, hence creating a memory leak.

This is mostly a theoretical issue as to my knowledge all messages sent are being handled and always get a response.

What to change

Implement the same solution as in Chrome: if the message receiver wants to use the callback asynchronously then it needs to explicitly say so (return true). If it doesn't and it doesn't send out a response synchronously either, then the abstraction layer can send a "response" itself: "no response coming, don't wait any more".

Attachments (0)

Change History (6)

comment:1 Changed on 12/19/2014 at 08:21:55 PM by sebastian

  • Cc sebastian added
  • Priority changed from Unknown to P2

Since #1708 we don't send an empty object as default (if there isn't a matching message type) anymore, increasing the potential of a memory leak here. So I think we should fix this rather sooner than later.

comment:2 Changed on 01/08/2015 at 02:15:08 PM by sebastian

  • Cc sebastian removed
  • Owner set to sebastian

comment:3 Changed on 01/08/2015 at 02:15:22 PM by sebastian

  • Resolution set to fixed
  • Review URL(s) modified (diff)
  • Status changed from new to closed

comment:4 Changed on 01/08/2015 at 02:15:29 PM by sebastian

  • Resolution fixed deleted
  • Status changed from closed to reopened

comment:5 Changed on 01/08/2015 at 02:15:37 PM by sebastian

  • Status changed from reopened to reviewing

comment:6 Changed on 01/08/2015 at 04:03:05 PM by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from sebastian.
 
Note: See TracTickets for help on using tickets.