summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--python/examples/notification_callbacks.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/examples/notification_callbacks.py b/python/examples/notification_callbacks.py
index d3cbf26b..24d798de 100644
--- a/python/examples/notification_callbacks.py
+++ b/python/examples/notification_callbacks.py
@@ -23,9 +23,15 @@ import inspect
from binaryninja import BinaryDataNotification, PluginCommand, log
+# Store the notification objects in an array, so they aren't deleted when the function ends
+notifications = []
+
+
def reg_notif(view):
+ global notifications
demo_notification = DemoNotification(view)
view.register_notification(demo_notification)
+ notifications.append(demo_notification)
class DemoNotification(BinaryDataNotification):