Ticket #4391 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

Delete editor macro results in infinite loop

Reported by: sxmboer2 Owned by: andrew_b
Priority: major Milestone: 4.8.29
Component: mcedit Version: master
Keywords: macro edit Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

Since version 4.8.27 removing an existing macro results in an infinite loop that dumps a repeating series of array assertion error.

To reproduce:
create a macro, e.g. CTRL-R abc CTRL-R a
remove that macro, e.g. CTRL-R CTRL-R a (or use the menu to delete that macro)

The problem was introduced because of the split of the macro functions with some rewrites and optimizations. I am including a patch that also gets rid of the unnecessary resorting of the macro array. The glib function called keeps the array sorted.
Another thought is that the while construction can be replaced with a single if. In principle it is impossible to have more than one macro with the same hotkey.

Attachments

macropatch.diff (827 bytes) - added by sxmboer2 2 years ago.
this patch fixes the mis-placed bracket in the while loop leading to infinite looping

Change History

Changed 2 years ago by sxmboer2

this patch fixes the mis-placed bracket in the while loop leading to infinite looping

comment:1 Changed 2 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b

comment:2 Changed 2 years ago by andrew_b

  • Branch state changed from no branch to on review

Thanks!

I've split your patch to two commits.

Branch:4391_edit_delete_macro
Initial changeset:c90840d5c7f577f453f8cc810527d078080e41e9

comment:3 Changed 2 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:4 Changed 2 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [1c31e57c74b533c4d54e4a1bdd8dd1684c7ef86f].

git log --pretty=oneline 82da1e88c..1c31e57c7

comment:5 Changed 2 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.