From ae4bf47445f675efdbae9ea87bc036f59e9cca0b Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Mon, 20 Jun 2022 22:15:44 -0400 Subject: Fix notification_callbacks.py example GCing the notifications --- python/examples/notification_callbacks.py | 6 ++++++ 1 file changed, 6 insertions(+) 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): -- cgit v1.3.1