aferrero2707 / PhotoFlow

A fully non-destructive photo retouching program providing a complete layer-based workflow including RAW image development.
http://aferrero2707.github.io/PhotoFlow
GNU General Public License v3.0
315 stars 36 forks source link

crash selecting empty layer #7

Closed hfiguiere closed 10 years ago

hfiguiere commented 10 years ago

Open TestImages/curves.pfi

Click in the layer that has no label (checkbox is unchecked)

It crashes.

(gdb) where
#0  0x0000000000585e49 in PF::Layer::get_id (this=0x0) at /home/hub/source/PhotoFlow/src/gui/../base/layer.hh:84
#1  0x0000000000584686 in PF::LayerWidget::get_selected_layer_id (this=0xfd88a8) at /home/hub/source/PhotoFlow/src/gui/layerwidget.cc:264
#2  0x000000000058360c in PF::LayerWidget::on_button_event (this=0xfd88a8, button=0x19aaa20) at /home/hub/source/PhotoFlow/src/gui/layerwidget.cc:142
#3  0x000000000058aa81 in sigc::bound_mem_functor1<bool, PF::LayerWidget, _GdkEventButton*>::operator() (this=0x12684d8, _A_a1=@0x7fffffffd468: 0x19aaa20)
    at /usr/include/sigc++-2.0/sigc++/functors/mem_fun.h:1851
#4  0x000000000058a270 in sigc::adaptor_functor<sigc::bound_mem_functor1<bool, PF::LayerWidget, _GdkEventButton*> >::operator()<_GdkEventButton* const&> (this=0x12684d0, 
    _A_arg1=@0x7fffffffd468: 0x19aaa20) at /usr/include/sigc++-2.0/sigc++/adaptors/adaptor_trait.h:84
#5  0x000000000058976b in sigc::internal::slot_call1<sigc::bound_mem_functor1<bool, PF::LayerWidget, _GdkEventButton*>, bool, _GdkEventButton*>::call_it (rep=0x12684a0, 
    a_1=@0x7fffffffd468: 0x19aaa20) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:137
#6  0x0000003315da2a8b in operator() (_A_a1=@0x7fffffffd468: 0x19aaa20, this=0x114f498) at /usr/include/sigc++-2.0/sigc++/functors/slot.h:515
#7  (anonymous namespace)::Widget_signal_button_release_event_callback (self=self@entry=0x124e7f0 [gtkmm__GtkTreeView], p0=0x19aaa20, data=data@entry=0x114f490) at widget.cc:1371
#8  0x00000033135b6c0c in _gtk_marshal_BOOLEAN__BOXED (closure=0x1268550, return_value=0x7fffffffd5a0, n_param_values=<optimized out>, param_values=0x7fffffffd650, 
    invocation_hint=<optimized out>, marshal_data=<optimized out>) at gtkmarshalers.c:85
#9  0x00000037f5210518 in g_closure_invoke (closure=0x1268550, return_value=return_value@entry=0x7fffffffd5a0, n_param_values=2, param_values=param_values@entry=0x7fffffffd650, 
    invocation_hint=invocation_hint@entry=0x7fffffffd5f0) at gclosure.c:768
#10 0x00000037f52228a1 in signal_emit_unlocked_R (node=node@entry=0xd15970, detail=detail@entry=0, instance=instance@entry=0x124e7f0, emission_return=emission_return@entry=0x7fffffffd700, 
    instance_and_params=instance_and_params@entry=0x7fffffffd650) at gsignal.c:3621
#11 0x00000037f522a06d in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd7e0) at gsignal.c:3317
#12 0x00000037f522a63f in g_signal_emit (instance=instance@entry=0x124e7f0, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3363
#13 0x00000033136ee48c in gtk_widget_event_internal (widget=widget@entry=0x124e7f0 [gtkmm__GtkTreeView], event=event@entry=0x19aaa20) at gtkwidget.c:7229
#14 0x00000033136ee769 in gtk_widget_event (widget=widget@entry=0x124e7f0 [gtkmm__GtkTreeView], event=event@entry=0x19aaa20) at gtkwidget.c:6891
#15 0x00000033135b46dc in propagate_event_up (topmost=<optimized out>, event=<optimized out>, widget=0x124e7f0 [gtkmm__GtkTreeView]) at gtkmain.c:2406
#16 propagate_event (widget=<optimized out>, event=0x19aaa20, captured=<optimized out>, topmost=0x0) at gtkmain.c:2514
#17 0x00000033135b61cd in gtk_main_do_event (event=0x19aaa20) at gtkmain.c:1735
#18 0x000000331304ff32 in gdk_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkeventsource.c:364
#19 0x00000037f4e49c3a in g_main_dispatch (context=0xd32c90) at gmain.c:3064
#20 g_main_context_dispatch (context=context@entry=0xd32c90) at gmain.c:3663
#21 0x00000037f4e49f88 in g_main_context_iterate (context=0xd32c90, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3734
#22 0x00000037f4e4a25a in g_main_loop_run (loop=0x1299410) at gmain.c:3928
#23 0x00000033135b54e5 in gtk_main () at gtkmain.c:1192
#24 0x0000003315d3d99d in Gtk::Main::run (window=...) at main.cc:398
#25 0x000000000056a3e2 in main (argc=2, argv=0x7fffffffe018) at /home/hub/source/PhotoFlow/src/main.cc:86
aferrero2707 commented 10 years ago

Fixed in master branch. Thanks a lot again for the detailed report.

By the way, those empty layers are just a temporary "dirty trick" to force the tree items correspoding to group layers to be shown as expandable, even when the group is empty... I still have to find a clean way to implement that.

hfiguiere commented 10 years ago

You can put disabled tree item with some phony label at least. But yeah GtkTreeItem aren't very nice for that use case.

aferrero2707 commented 10 years ago

My idea was to use Gtk::TreeModelFilter to hide those rows, but I still need to check that this would work as I expect (i.e. have tree items that look at the same time expanable and "empty").