[go: up one dir, main page]

"Layer from group" action crash fix

The layer_from_group() function does not check whether a selection is a group and if it's not then this happens:

Thread 1 "inkscape" received signal SIGSEGV, Segmentation fault.
SPGroup::setLayerMode (this=this@entry=0x0, mode=mode@entry=SPGroup::LAYER) at src/object/sp-item-group.cpp:769
769	    if ( _layer_mode != mode ) {
(gdb) bt
#0  SPGroup::setLayerMode(SPGroup::LayerMode) (this=this@entry=0x0, mode=mode@entry=SPGroup::LAYER) at src/object/sp-item-group.cpp:769
#1  0x00007ffff7782ca8 in layer_from_group(InkscapeWindow*) (win=<optimized out>) at src/actions/actions-layer.cpp:414
#2  0x00007ffff7765bd4 in sigc::pointer_functor1<InkscapeWindow*, void>::operator()(InkscapeWindow* const&) const (_A_a1=<optimized out>, this=<optimized out>)
    at /usr/include/sigc++-2.0/sigc++/functors/ptr_fun.h:111
...

Have not found the crash in the tracker.

This MR adds a simple condition to test whether a selection is a group.

Merge request reports

Loading