Opened 5 years ago

Last modified 5 years ago

#3432 new change

Treat COM events as a resource with RAII

Reported by: eric@… Assignee:
Priority: P3 Milestone:
Module: Adblock-Plus-for-Internet-Explorer Keywords:
Cc: Blocked By:
Blocking: #3382 Platform: Internet Explorer
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):



The current way of registering events is ad hoc and somewhat unreliable. We have an explicit call to start events in one place and calls to stop them scattered throughout the code.

What to change

Treat a COM event registration as a resource and manage it with RAII. This simplifies the code, ensuring that events will automatically stop before the destruction of their sink object, eliminating any possibility of a null pointer dereference in the event source.

Stopping events is used to handle certain error conditions, but not in a particularly reliable way. Fixing this issue may require separating out these other concerns.

Change History (2)

comment:1 Changed 5 years ago by eric@…

  • Blocked By 3382 removed
  • Blocking 3382 added

comment:2 Changed 5 years ago by eric@…

  • Priority changed from Unknown to P3
Note: See TracTickets for help on using tickets.