After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705642 - Wrap GtkPlacesSidebar
Wrap GtkPlacesSidebar
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: general
3.9.x
Other All
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2013-08-07 20:48 UTC by Juan R. Garcia Blanco
Modified: 2013-09-25 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Wrap (partially) GtkPlacesSidebar (15.43 KB, patch)
2013-08-07 20:48 UTC, Juan R. Garcia Blanco
needs-work Details | Review
Wrap GtkPlacesSidebar (not fully working) (7.62 KB, patch)
2013-09-11 19:06 UTC, Juan R. Garcia Blanco
none Details | Review
Wrap GtkPlacesSidebar (not complete) (21.14 KB, patch)
2013-09-11 20:40 UTC, Juan R. Garcia Blanco
needs-work Details | Review
New version of GtkPlacesSidebar wrapper (21.46 KB, patch)
2013-09-13 21:41 UTC, Juan R. Garcia Blanco
none Details | Review
Wrap GtkPlacesSidebar (21.41 KB, patch)
2013-09-17 20:25 UTC, Juan R. Garcia Blanco
none Details | Review
Gtk::PlacesSidebar example (2.31 KB, application/octet-stream)
2013-09-22 17:59 UTC, Juan R. Garcia Blanco
  Details

Description Juan R. Garcia Blanco 2013-08-07 20:48:47 UTC
Created attachment 251108 [details] [review]
Wrap (partially) GtkPlacesSidebar

I've tried to wrap GtkPlacesSidebar. I've not finished it yet, since I would need to investigate more on how to wrap signals correctly (I think I will ask in the mailing list). Anyways I upload what I've already done. I will much appreciate some feedback. If someone wants to continue this task maybe this patch could serve as a starting point.
Comment 1 Murray Cumming 2013-08-28 12:22:47 UTC
Review of attachment 251108 [details] [review]:

This looks good. Thanks. It just needs a few small changes.

::: gtk/src/placessidebar.hg
@@ +75,3 @@
+  _WRAP_METHOD(void set_location(const Glib::RefPtr<const Gio::File>& location), gtk_places_sidebar_set_location)
+  // transfer full
+  _WRAP_METHOD(const Glib::RefPtr<const Gio::File> get_location() const, gtk_places_sidebar_get_location, constversion)

The first const is superfluous/meaningless.

@@ +84,3 @@
+  _WRAP_METHOD(void remove_shortcut(const Glib::RefPtr<const Gio::File>& location), gtk_places_sidebar_remove_shortcut)
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Gio::File> >',`Glib::SListHandler< Glib::RefPtr< Gio::File> >::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')
+  _WRAP_METHOD(std::vector< Glib::RefPtr<Gio::File> > list_shortcuts(), gtk_places_sidebar_list_shortcuts)

This should have a const version too, please.

_WRAP_METHOD(std::vector< Glib::RefPtr<const Gio::File> > list_shortcuts() const, gtk_places_sidebar_list_shortcuts)

@@ +87,3 @@
+
+  // transfer full
+  _WRAP_METHOD(const Glib::RefPtr<const Gio::File>  get_nth_bookmark(int n) const, gtk_places_sidebar_get_nth_bookmark, constversion)

The first const is superfluous/meaningless.

@@ +97,3 @@
+// TODO  _WRAP_SIGNAL(int drag_action_requested(const Glib::RefPtr< Gdk::DragContext>& context, Glib::RefPtr< Glib::Object>& dest_file, ), "drag_action_requested", no_default_handler);
+// TODO  _WRAP_SIGNAL(void drag_perform_drop(const Glib::RefPtr< Glib::Object>& dest_file), "drag_perform_drop", no_default_handler);
+  _WRAP_SIGNAL(void open_location(const Glib::RefPtr<Glib::Object>& location, PlacesOpenFlags open_flags), "open_location", no_default_handler);

Is there any suitable default value for open_flags?

@@ +98,3 @@
+// TODO  _WRAP_SIGNAL(void drag_perform_drop(const Glib::RefPtr< Glib::Object>& dest_file), "drag_perform_drop", no_default_handler);
+  _WRAP_SIGNAL(void open_location(const Glib::RefPtr<Glib::Object>& location, PlacesOpenFlags open_flags), "open_location", no_default_handler);
+  _WRAP_SIGNAL(void populate_popup(const Glib::RefPtr<Glib::Object>& menu, const Glib::RefPtr<Glib::Object>& selected_item, const Glib::RefPtr<Glib::Object>& selected_volume), "populate_popup", no_default_handler);

You shouldn't need to use no_default_handler. That's only for maintaining ABI in an existing class.
Comment 2 Kjell Ahlstedt 2013-09-09 08:04:26 UTC
(In reply to comment #1)
> + _WRAP_SIGNAL(void open_location(const Glib::RefPtr<Glib::Object>& location,
> PlacesOpenFlags open_flags), "open_location", no_default_handler);
>
> Is there any suitable default value for open_flags?

Are default values meaningful in signal handlers? Aren't they always called
with all parameters specified? I searched for _WRAP_SIGNAL with a default value
in glibmm and gtkmm. I found none.

> You shouldn't need to use no_default_handler. That's only for maintaining ABI
> in an existing class.

The problem with GtkPlacesSidebar is that GtkPlacesSidebarClass is defined in
gtkplacessidebar.c. Usually Gtk*Class structs with signals and/or vfuncs are
defined in .h files. A default handler, such as Gtk::PlacesSidebar::
on_populate_popup(), can't call GtkPlacesSidebarClass::populate_popup().
Comment 3 Juan R. Garcia Blanco 2013-09-11 19:06:25 UTC
Created attachment 254732 [details] [review]
Wrap GtkPlacesSidebar (not fully working)

This is an updated version of my previous patch. It seems complete, but please note that the following signals are known to be not working:
drag-action-request
drag-perform-drop

I'm still investigating why this does not work. I need to understand a bit more how gmmproc works.
Comment 4 Juan R. Garcia Blanco 2013-09-11 20:40:46 UTC
Created attachment 254738 [details] [review]
Wrap GtkPlacesSidebar (not complete)

Sorry, I messed things up; the last patch was wrong. Here's the correct one.
Comment 5 Murray Cumming 2013-09-12 08:06:13 UTC
Review of attachment 254738 [details] [review]:

Looks good. I made some comments.

::: gtk/src/placessidebar.hg
@@ +73,3 @@
+
+
+  _WRAP_METHOD(void set_open_flags(PlacesOpenFlags flags=Gtk::PLACES_OPEN_NORMAL), gtk_places_sidebar_set_open_flags)

Please use a space on either side of = for default parameters.

@@ +79,3 @@
+  // transfer full
+  _WRAP_METHOD(Glib::RefPtr<const Gio::File> get_location() const, gtk_places_sidebar_get_location)
+  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_location(), gtk_places_sidebar_get_location)

The constversion parameter provides a small optimization here.

However, because gtk_places_sidebar_get_location() seems to return a new instance of GFile, maybe we can have just a const method that returns a non-const Fio::File, because changing the File would not change the PlacesSidebar that provided it. For instance:

Glib::RefPtr<Gio::File> get_location() const.

That looks a bit odd, so I'd welcome some disagreement. If we do that, we should have a comment saying why. Sorry for not checking these C functions before.

@@ +87,3 @@
+  _WRAP_METHOD(void remove_shortcut(const Glib::RefPtr<Gio::File>& location), gtk_places_sidebar_remove_shortcut)
+  // transfer full
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const Gio::File> >',`Glib::SListHandler< Glib::RefPtr<const Gio::File> >::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')

If transfer is really full here then why do we need a deep copy?

As above, maybe we can have just a const method that returns non const elements, because changing the File elements would not change the PlacesSidebar that provided them.

@@ +94,3 @@
+  // transfer full
+  _WRAP_METHOD(Glib::RefPtr<const Gio::File>  get_nth_bookmark(int n) const, gtk_places_sidebar_get_nth_bookmark)
+  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_nth_bookmark(int n), gtk_places_sidebar_get_nth_bookmark)

Again, because gtk_places_sidebar_get_nth_bookmark() seems to return a new instance of GFile, maybe we can have just a const method that returns a non-const Fio::File, because changing the File would not change the PlacesSidebar that provided it.

@@ +110,3 @@
+  _WRAP_SIGNAL(void populate_popup(Gtk::Menu* menu, const Glib::RefPtr<Gio::File>& selected_item, const Glib::RefPtr<Gio::Volume>& selected_volume), "populate_popup", no_default_handler)
+  _WRAP_SIGNAL(void show_connect_to_server(), "show_connect_to_server", no_default_handler)
+  _WRAP_SIGNAL(void show_error_message(const Glib::ustring& primary, const Glib::ustring& secondary), "show_error_message", no_default_handler)

If any of these signals are causing problems, could you please comment them out with a brief explanation of the problem.
Comment 6 Murray Cumming 2013-09-12 08:06:31 UTC
Review of attachment 254738 [details] [review]:

Looks good. I made some comments.

::: gtk/src/placessidebar.hg
@@ +73,3 @@
+
+
+  _WRAP_METHOD(void set_open_flags(PlacesOpenFlags flags=Gtk::PLACES_OPEN_NORMAL), gtk_places_sidebar_set_open_flags)

Please use a space on either side of = for default parameters.

@@ +79,3 @@
+  // transfer full
+  _WRAP_METHOD(Glib::RefPtr<const Gio::File> get_location() const, gtk_places_sidebar_get_location)
+  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_location(), gtk_places_sidebar_get_location)

The constversion parameter provides a small optimization here.

However, because gtk_places_sidebar_get_location() seems to return a new instance of GFile, maybe we can have just a const method that returns a non-const Fio::File, because changing the File would not change the PlacesSidebar that provided it. For instance:

Glib::RefPtr<Gio::File> get_location() const.

That looks a bit odd, so I'd welcome some disagreement. If we do that, we should have a comment saying why. Sorry for not checking these C functions before.

@@ +87,3 @@
+  _WRAP_METHOD(void remove_shortcut(const Glib::RefPtr<Gio::File>& location), gtk_places_sidebar_remove_shortcut)
+  // transfer full
+#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<const Gio::File> >',`Glib::SListHandler< Glib::RefPtr<const Gio::File> >::slist_to_vector($3, Glib::OWNERSHIP_DEEP)')

If transfer is really full here then why do we need a deep copy?

As above, maybe we can have just a const method that returns non const elements, because changing the File elements would not change the PlacesSidebar that provided them.

@@ +94,3 @@
+  // transfer full
+  _WRAP_METHOD(Glib::RefPtr<const Gio::File>  get_nth_bookmark(int n) const, gtk_places_sidebar_get_nth_bookmark)
+  _WRAP_METHOD(Glib::RefPtr<Gio::File> get_nth_bookmark(int n), gtk_places_sidebar_get_nth_bookmark)

Again, because gtk_places_sidebar_get_nth_bookmark() seems to return a new instance of GFile, maybe we can have just a const method that returns a non-const Fio::File, because changing the File would not change the PlacesSidebar that provided it.

@@ +110,3 @@
+  _WRAP_SIGNAL(void populate_popup(Gtk::Menu* menu, const Glib::RefPtr<Gio::File>& selected_item, const Glib::RefPtr<Gio::Volume>& selected_volume), "populate_popup", no_default_handler)
+  _WRAP_SIGNAL(void show_connect_to_server(), "show_connect_to_server", no_default_handler)
+  _WRAP_SIGNAL(void show_error_message(const Glib::ustring& primary, const Glib::ustring& secondary), "show_error_message", no_default_handler)

If any of these signals are causing problems, could you please comment them out with a brief explanation of the problem.
Comment 7 Juan R. Garcia Blanco 2013-09-13 21:41:47 UTC
Created attachment 254886 [details] [review]
New version of GtkPlacesSidebar wrapper

Here's a new version taking into account the review to the last patch. The two signals that do not currently work are commented out; I'm investigating what happens with those two signals: why wrapping a GList* fails.

Thank you very much for your kind support :)
Comment 8 Juan R. Garcia Blanco 2013-09-17 20:25:51 UTC
Created attachment 255135 [details] [review]
Wrap GtkPlacesSidebar

This patch is similar to the last one, except for a few constversion that have been removed to avoid infinite recursion. I have not solved the drag_action_requested and drag_perform_drop issues yet.
Comment 9 Murray Cumming 2013-09-18 07:33:34 UTC
Thanks. I have pushed that.

We can add the missing signal wrappers later if we can fix the problems. Do you have some example code that reproduces the problem?
Comment 10 Juan R. Garcia Blanco 2013-09-22 17:59:03 UTC
Created attachment 255531 [details]
Gtk::PlacesSidebar example

Here's the example I was working on. To reproduce the problems just try to drag some files to the places sidebar.
Comment 11 Murray Cumming 2013-09-23 12:16:20 UTC
Thanks. I have added that to git master of gtkmm-documentation, with some minor changes, and the use of one of those problem signals commented out.

The problem seems to be caused by the signal wrapper rather than just the use of the signal wrapper.
Comment 12 Murray Cumming 2013-09-23 12:17:23 UTC
And this is what valgrind says about the example:

==29484== Invalid read of size 8
==29484==    at 0x781551C: g_object_unref (gobject.c:3089)
==29484==    by 0x5F587B3: open_selected_bookmark.part.4 (gtkplacessidebar.c:2255)
==29484==    by 0x5F58B2A: bookmarks_key_press_event_cb (gtkplacessidebar.c:3032)
==29484==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==29484==    by 0x7810CC7: g_closure_invoke (gclosure.c:777)
==29484==    by 0x78230BC: signal_emit_unlocked_R (gsignal.c:3586)
==29484==    by 0x782A75E: g_signal_emit_valist (gsignal.c:3340)
==29484==    by 0x782B4B1: g_signal_emit (gsignal.c:3386)
==29484==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==29484==    by 0x606D49A: gtk_window_propagate_key_event (gtkwindow.c:7193)
==29484==    by 0x60704E2: gtk_window_key_press_event (gtkwindow.c:7223)
==29484==    by 0x4F8CBA3: Gtk::Widget::on_key_press_event(_GdkEventKey*) (widget.cc:8206)
==29484==    by 0x4F8EE83: Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) (widget.cc:4804)
==29484==    by 0x5F10C7D: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:130)
==29484==    by 0x7810EF6: _g_closure_invoke_va (gclosure.c:840)
==29484==    by 0x782ABB2: g_signal_emit_valist (gsignal.c:3238)
==29484==    by 0x782B4B1: g_signal_emit (gsignal.c:3386)
==29484==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==29484==    by 0x5F0F0BE: propagate_event (gtkmain.c:2490)
==29484==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==29484==    by 0x6785141: gdk_event_source_dispatch (gdkeventsource.c:364)
==29484==    by 0x7A99DD5: g_main_context_dispatch (gmain.c:3065)
==29484==    by 0x7A9A127: g_main_context_iterate.isra.23 (gmain.c:3712)
==29484==    by 0x7A9A1CB: g_main_context_iteration (gmain.c:3773)
==29484==    by 0x6CB233B: g_application_run (gapplication.c:1635)
==29484==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==29484==    by 0x406DCB: main (main.cc:27)
==29484==  Address 0x124e9090 is 0 bytes inside a block of size 40 free'd
==29484==    at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==29484==    by 0x7A9F92E: g_free (gmem.c:197)
==29484==    by 0x7AB596A: g_slice_free1 (gslice.c:1124)
==29484==    by 0x7832840: g_type_free_instance (gtype.c:1938)
==29484==    by 0x78366C2: g_value_unset (gvalue.c:274)
==29484==    by 0x782B24B: g_signal_emit_valist (gsignal.c:3359)
==29484==    by 0x782B4B1: g_signal_emit (gsignal.c:3386)
==29484==    by 0x5F587AB: open_selected_bookmark.part.4 (gtkplacessidebar.c:2254)
==29484==    by 0x5F58B2A: bookmarks_key_press_event_cb (gtkplacessidebar.c:3032)
==29484==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==29484==    by 0x7810CC7: g_closure_invoke (gclosure.c:777)
==29484==    by 0x78230BC: signal_emit_unlocked_R (gsignal.c:3586)
==29484==    by 0x782A75E: g_signal_emit_valist (gsignal.c:3340)
==29484==    by 0x782B4B1: g_signal_emit (gsignal.c:3386)
==29484==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==29484==    by 0x606D49A: gtk_window_propagate_key_event (gtkwindow.c:7193)
==29484==    by 0x60704E2: gtk_window_key_press_event (gtkwindow.c:7223)
==29484==    by 0x4F8CBA3: Gtk::Widget::on_key_press_event(_GdkEventKey*) (widget.cc:8206)
==29484==    by 0x4F8EE83: Gtk::Widget_Class::key_press_event_callback(_GtkWidget*, _GdkEventKey*) (widget.cc:4804)
==29484==    by 0x5F10C7D: _gtk_marshal_BOOLEAN__BOXEDv (gtkmarshalers.c:130)
==29484==    by 0x7810EF6: _g_closure_invoke_va (gclosure.c:840)
==29484==    by 0x782ABB2: g_signal_emit_valist (gsignal.c:3238)
==29484==    by 0x782B4B1: g_signal_emit (gsignal.c:3386)
==29484==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==29484==    by 0x5F0F0BE: propagate_event (gtkmain.c:2490)
==29484==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==29484==    by 0x6785141: gdk_event_source_dispatch (gdkeventsource.c:364)
==29484==    by 0x7A99DD5: g_main_context_dispatch (gmain.c:3065)
==29484==    by 0x7A9A127: g_main_context_iterate.isra.23 (gmain.c:3712)
==29484==    by 0x7A9A1CB: g_main_context_iteration (gmain.c:3773)
==29484==    by 0x6CB233B: g_application_run (gapplication.c:1635)
==29484==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==29484==    by 0x406DCB: main (main.cc:27)
Comment 13 Juan R. Garcia Blanco 2013-09-24 20:49:43 UTC
I solved a bug in signals that take a GFile as argument (e.g. open-location), but I haven't time to investigate the drag_* issues.
Comment 14 Murray Cumming 2013-09-25 04:42:50 UTC
If you have a bug fix could you attach it here, please.

I will take a look at this soon.
Comment 15 Murray Cumming 2013-09-25 09:25:53 UTC
I have corrected OWNERSHIP_SHALLOW to OWNERSHIP_NONE for these signals, as suggested by the C documentation, but I am still getting the same crash:

[murrayc@localhost examples (master)]$ valgrind --num-callers=50 ./book/placessidebar/example 
==14543== Memcheck, a memory error detector
==14543== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==14543== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==14543== Command: ./book/placessidebar/example
==14543== 
Gtk-Message: Failed to load module "pk-gtk-module"
Gtk-Message: Failed to load module "canberra-gtk-module"
Shortcuts:
==14543== Invalid read of size 8
==14543==    at 0x781651C: g_object_unref (gobject.c:3089)
==14543==    by 0x5F587B3: open_selected_bookmark.part.4 (gtkplacessidebar.c:2255)
==14543==    by 0x5F5896F: bookmarks_row_activated_cb (gtkplacessidebar.c:3274)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x78240BC: signal_emit_unlocked_R (gsignal.c:3586)
==14543==    by 0x782C213: g_signal_emit_valist (gsignal.c:3330)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x603BF0B: gtk_tree_view_button_release (gtktreeview.c:3499)
==14543==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x7823E7A: signal_emit_unlocked_R (gsignal.c:3624)
==14543==    by 0x782B75E: g_signal_emit_valist (gsignal.c:3340)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==14543==    by 0x5F0EF9B: propagate_event (gtkmain.c:2393)
==14543==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==14543==    by 0x6786141: gdk_event_source_dispatch (gdkeventsource.c:364)
==14543==    by 0x7A9ADD5: g_main_context_dispatch (gmain.c:3065)
==14543==    by 0x7A9B127: g_main_context_iterate.isra.23 (gmain.c:3712)
==14543==    by 0x7A9B1CB: g_main_context_iteration (gmain.c:3773)
==14543==    by 0x6CB333B: g_application_run (gapplication.c:1635)
==14543==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==14543==    by 0x406DCB: main (main.cc:27)
==14543==  Address 0x1d1d0a30 is 0 bytes inside a block of size 32 free'd
==14543==    at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==14543==    by 0x7AA092E: g_free (gmem.c:197)
==14543==    by 0x7AB696A: g_slice_free1 (gslice.c:1124)
==14543==    by 0x7833840: g_type_free_instance (gtype.c:1938)
==14543==    by 0x78376C2: g_value_unset (gvalue.c:274)
==14543==    by 0x782C24B: g_signal_emit_valist (gsignal.c:3359)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x5F587AB: open_selected_bookmark.part.4 (gtkplacessidebar.c:2254)
==14543==    by 0x5F5896F: bookmarks_row_activated_cb (gtkplacessidebar.c:3274)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x78240BC: signal_emit_unlocked_R (gsignal.c:3586)
==14543==    by 0x782C213: g_signal_emit_valist (gsignal.c:3330)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x603BF0B: gtk_tree_view_button_release (gtktreeview.c:3499)
==14543==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x7823E7A: signal_emit_unlocked_R (gsignal.c:3624)
==14543==    by 0x782B75E: g_signal_emit_valist (gsignal.c:3340)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==14543==    by 0x5F0EF9B: propagate_event (gtkmain.c:2393)
==14543==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==14543==    by 0x6786141: gdk_event_source_dispatch (gdkeventsource.c:364)
==14543==    by 0x7A9ADD5: g_main_context_dispatch (gmain.c:3065)
==14543==    by 0x7A9B127: g_main_context_iterate.isra.23 (gmain.c:3712)
==14543==    by 0x7A9B1CB: g_main_context_iteration (gmain.c:3773)
==14543==    by 0x6CB333B: g_application_run (gapplication.c:1635)
==14543==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==14543==    by 0x406DCB: main (main.cc:27)
==14543== 
==14543== Invalid read of size 8
==14543==    at 0x7816524: g_object_unref (gobject.c:3089)
==14543==    by 0x5F587B3: open_selected_bookmark.part.4 (gtkplacessidebar.c:2255)
==14543==    by 0x5F5896F: bookmarks_row_activated_cb (gtkplacessidebar.c:3274)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x78240BC: signal_emit_unlocked_R (gsignal.c:3586)
==14543==    by 0x782C213: g_signal_emit_valist (gsignal.c:3330)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x603BF0B: gtk_tree_view_button_release (gtktreeview.c:3499)
==14543==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x7823E7A: signal_emit_unlocked_R (gsignal.c:3624)
==14543==    by 0x782B75E: g_signal_emit_valist (gsignal.c:3340)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==14543==    by 0x5F0EF9B: propagate_event (gtkmain.c:2393)
==14543==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==14543==    by 0x6786141: gdk_event_source_dispatch (gdkeventsource.c:364)
==14543==    by 0x7A9ADD5: g_main_context_dispatch (gmain.c:3065)
==14543==    by 0x7A9B127: g_main_context_iterate.isra.23 (gmain.c:3712)
==14543==    by 0x7A9B1CB: g_main_context_iteration (gmain.c:3773)
==14543==    by 0x6CB333B: g_application_run (gapplication.c:1635)
==14543==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==14543==    by 0x406DCB: main (main.cc:27)
==14543==  Address 0xaaaaaaaaaaaaaaaa is not stack'd, malloc'd or (recently) free'd
==14543== 
==14543== 
==14543== Process terminating with default action of signal 11 (SIGSEGV)
==14543==  General Protection Fault
==14543==    at 0x7816524: g_object_unref (gobject.c:3089)
==14543==    by 0x5F587B3: open_selected_bookmark.part.4 (gtkplacessidebar.c:2255)
==14543==    by 0x5F5896F: bookmarks_row_activated_cb (gtkplacessidebar.c:3274)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x78240BC: signal_emit_unlocked_R (gsignal.c:3586)
==14543==    by 0x782C213: g_signal_emit_valist (gsignal.c:3330)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x603BF0B: gtk_tree_view_button_release (gtktreeview.c:3499)
==14543==    by 0x5F10B8B: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:85)
==14543==    by 0x7811CC7: g_closure_invoke (gclosure.c:777)
==14543==    by 0x7823E7A: signal_emit_unlocked_R (gsignal.c:3624)
==14543==    by 0x782B75E: g_signal_emit_valist (gsignal.c:3340)
==14543==    by 0x782C4B1: g_signal_emit (gsignal.c:3386)
==14543==    by 0x604E483: gtk_widget_event_internal (gtkwidget.c:7154)
==14543==    by 0x5F0EF9B: propagate_event (gtkmain.c:2393)
==14543==    by 0x5F10841: gtk_main_do_event (gtkmain.c:1716)
==14543==    by 0x6786141: gdk_event_source_dispatch (gdkeventsource.c:364)
==14543==    by 0x7A9ADD5: g_main_context_dispatch (gmain.c:3065)
==14543==    by 0x7A9B127: g_main_context_iterate.isra.23 (gmain.c:3712)
==14543==    by 0x7A9B1CB: g_main_context_iteration (gmain.c:3773)
==14543==    by 0x6CB333B: g_application_run (gapplication.c:1635)
==14543==    by 0x4EEF855: Gtk::Application::run(Gtk::Window&) (application.cc:168)
==14543==    by 0x406DCB: main (main.cc:27)
==14543== 
==14543== HEAP SUMMARY:
==14543==     in use at exit: 2,234,202 bytes in 29,649 blocks
==14543==   total heap usage: 154,056 allocs, 124,407 frees, 9,791,907 bytes allocated
==14543== 
==14543== LEAK SUMMARY:
==14543==    definitely lost: 19,856 bytes in 35 blocks
==14543==    indirectly lost: 38,202 bytes in 1,081 blocks
==14543==      possibly lost: 100,248 bytes in 1,486 blocks
==14543==    still reachable: 1,931,112 bytes in 26,123 blocks
==14543==         suppressed: 0 bytes in 0 blocks
==14543== Rerun with --leak-check=full to see details of leaked memory
==14543== 
==14543== For counts of detected and suppressed errors, rerun with: -v
==14543== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 2 from 2)
Killed
Comment 16 Murray Cumming 2013-09-25 09:47:56 UTC
This fixes the crash:
https://git.gnome.org/browse/gtkmm/commit/?id=2713b4f8bb575675816f61551b9072062653f28b

I guess it's what you meant.
Comment 17 Juan R. Garcia Blanco 2013-09-25 18:46:58 UTC
Nice! Yeah, I added take_copy=true when converting GFile* to RefPtr<File>, but I left that in convert_gtk.m4. Now I know that should be in the .hg local to the signal :) I've learned a lot, thank you very much!