diff options
| author | Glenn Smith <glenn@vector35.com> | 2022-06-20 22:15:44 -0400 |
|---|---|---|
| committer | Glenn Smith <glenn@vector35.com> | 2022-06-20 22:15:44 -0400 |
| commit | ae4bf47445f675efdbae9ea87bc036f59e9cca0b (patch) | |
| tree | 51e52d3ae54d6cc9088fb901a5e9bca1ba7570b0 /python/examples | |
| parent | 317a7dd4437feac20dc420939108c198f01210cd (diff) | |
Fix notification_callbacks.py example GCing the notifications
Diffstat (limited to 'python/examples')
| -rw-r--r-- | python/examples/notification_callbacks.py | 6 |
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): |
