nkiesel...
Thanks for the patch.
I think your code is probably OK. Sean has done major
work done to refactor Tracks away from Routes, to support faster rendering of large/complex tracks. Not surprising that edge cases get missed.
Consider github commit:
639f9673057e92d4cc96b431e925e23af8dfbb7b
which brings in a whole new track list(vector) implementation.
Also, note that you can invoke
RouteManagerDialog::OnTrkMenuSelected()
by right-clicking on a track-point item(row) in the RouteManagerDialog.
If Sean has no comments, I'll merge your Pull Request.
Thanks again
Dave