Avoid a segfault while editing a ruler. This happens is both a selection and a transient selection is active.

This commit is contained in:
Matthias Koefferlein 2023-02-19 19:00:02 +01:00
parent 0a15425745
commit df562f502a
4 changed files with 14 additions and 1 deletions

View File

@ -133,6 +133,12 @@ Object::Object (const ant::Object &d)
// .. nothing else .. // .. nothing else ..
} }
Object::~Object ()
{
// .. nothing yet ..
}
Object & Object &
Object::operator= (const ant::Object &d) Object::operator= (const ant::Object &d)
{ {

View File

@ -137,6 +137,11 @@ public:
*/ */
Object &operator= (const ant::Object &d); Object &operator= (const ant::Object &d);
/**
* @brief Destructor
*/
~Object ();
/** /**
* @brief Less operator * @brief Less operator
*/ */

View File

@ -1009,6 +1009,7 @@ View::ruler (const ant::Object *r)
void void
View::render (const lay::Viewport &vp, lay::ViewObjectCanvas &canvas) View::render (const lay::Viewport &vp, lay::ViewObjectCanvas &canvas)
{ {
// .. nothing yet ..
if (! mp_ruler) { if (! mp_ruler) {
return; return;
} }
@ -1700,6 +1701,7 @@ Service::end_move (const db::DPoint &, lay::angle_constraint_type)
void void
Service::selection_to_view () Service::selection_to_view ()
{ {
clear_transient_selection ();
annotation_selection_changed_event (); annotation_selection_changed_event ();
// the selection objects need to be recreated since we destroyed the old rulers // the selection objects need to be recreated since we destroyed the old rulers

View File

@ -195,7 +195,7 @@ AnnotationShapes::replace (iterator pos, const shape_type &&sh)
manager ()->queue (this, new AnnotationLayerOp (true /*insert*/, sh)); manager ()->queue (this, new AnnotationLayerOp (true /*insert*/, sh));
} }
invalidate_state (); // HINT: must come before the change is done! invalidate_state (); // HINT: must come before the change is done!
m_layer.replace (pos, sh); m_layer.replace (pos, std::move (sh));
} }
return *pos; return *pos;
} }