Skip to content

Commit e824ffd

Browse files
committed
Fix BinaryDataNotification errors when subscribed to undo notifications
1 parent c579c0f commit e824ffd

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

python/binaryview.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ def type_archive_connected(self, view: 'BinaryView', archive: 'typearchive.TypeA
421421
def type_archive_disconnected(self, view: 'BinaryView', archive: 'typearchive.TypeArchive'):
422422
pass
423423

424+
def undo_entry_added(self, view: 'BinaryView', entry: 'undo.UndoEntry'):
425+
pass
426+
427+
def undo_entry_taken(self, view: 'BinaryView', entry: 'undo.UndoEntry'):
428+
pass
429+
430+
def redo_entry_taken(self, view: 'BinaryView', entry: 'undo.UndoEntry'):
431+
pass
432+
424433

425434
class StringReference:
426435
_decodings = {
@@ -1169,23 +1178,23 @@ def _type_archive_disconnected(self, ctxt, view: core.BNBinaryView, archive: cor
11691178
except:
11701179
log_error(traceback.format_exc())
11711180

1172-
def _undo_entry_added(self, ctxt, view: core.BNBinaryView, archive: core.BNUndoEntry):
1181+
def _undo_entry_added(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry):
11731182
try:
1174-
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(archive))
1183+
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry))
11751184
self._notify.undo_entry_added(self._view, py_entry)
11761185
except:
11771186
log_error(traceback.format_exc())
11781187

1179-
def _undo_entry_taken(self, ctxt, view: core.BNBinaryView, archive: core.BNUndoEntry):
1188+
def _undo_entry_taken(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry):
11801189
try:
1181-
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(archive))
1190+
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry))
11821191
self._notify.undo_entry_taken(self._view, py_entry)
11831192
except:
11841193
log_error(traceback.format_exc())
11851194

1186-
def _redo_entry_taken(self, ctxt, view: core.BNBinaryView, archive: core.BNUndoEntry):
1195+
def _redo_entry_taken(self, ctxt, view: core.BNBinaryView, entry: core.BNUndoEntry):
11871196
try:
1188-
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(archive))
1197+
py_entry = undo.UndoEntry(handle=core.BNNewUndoEntryReference(entry))
11891198
self._notify.redo_entry_taken(self._view, py_entry)
11901199
except:
11911200
log_error(traceback.format_exc())

0 commit comments

Comments
 (0)