summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorBrian Potchik <brian@vector35.com>2023-08-15 19:44:19 -0400
committerBrian Potchik <brian@vector35.com>2023-08-15 19:44:19 -0400
commitf67e44770bc4666e725b2f5b1617d93e580996bc (patch)
tree246d555699a2b5209d9b43f7324c1941fc73ff14 /python/binaryview.py
parenta8db4e8cda2d66789f4bdb21e1000c9d7860cde2 (diff)
Fix potential crash with register_notification and add support for notification_barrier requests.
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py10
1 files changed, 8 insertions, 2 deletions
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