From f67e44770bc4666e725b2f5b1617d93e580996bc Mon Sep 17 00:00:00 2001 From: Brian Potchik Date: Tue, 15 Aug 2023 19:44:19 -0400 Subject: Fix potential crash with register_notification and add support for notification_barrier requests. --- python/binaryview.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'python/binaryview.py') diff --git a/python/binaryview.py b/python/binaryview.py index 090b8921..80edc811 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3779,12 +3779,18 @@ class BinaryView: def register_notification(self, notify: BinaryDataNotification) -> None: """ - `register_notification` provides a mechanism for receiving callbacks for various analysis events. A full - list of callbacks can be seen in :py:class:`BinaryDataNotification`. + `register_notification` enables the receipt of callbacks for various analysis events. A full + list of callbacks is available in the :py:class:`BinaryDataNotification` class. If the + `notification_barrier` is enabled, then it is triggered upon the initial call to + `register_notification`. Subsequent calls for an already registered ``notify`` instance + also trigger a `notification_barrier` callback. :param BinaryDataNotification notify: notify is a subclassed instance of :py:class:`BinaryDataNotification`. :rtype: None """ + if notify in self._notifications: + self._notifications[notify]._register() + return cb = BinaryDataNotificationCallbacks(self, notify) cb._register() self._notifications[notify] = cb -- cgit v1.3.1