Le 30/12/2016 à 22:48, Jean-Marc Lasgouttes a écrit :
At some time where DEPM was causing issues, there was the idea of
registering cursors with their buffer. This would allow to keep track
of what is happening.
Another possibility would be to register insets, so that one can know
when cursor.inset() is not valid anymore. Or to turn this method into
some slower thing that reads the structures to find the inset.
Using weak pointers instead of naked pointers could be used to let you
know when an inset has been destroyed. The cursor could then check if
all slices are valid, and if not then fix itself. This would implement
the original intent that the pointer is "some kind of cache" (according
to a comment) for the slower thing you mention.
I do not see any other realistic solution. Indeed, non-trivial work
seems to be done in some Inset destructors, which makes any solution
that alters the lifetime of the insets risky.