linebender / druid

A data-first Rust-native UI design toolkit.
https://linebender.org/druid/
Apache License 2.0
9.59k stars 567 forks source link

Memory Leaks with multiple windows on Windows, Gtk and X11 #2001

Open gqf2008 opened 3 years ago

gqf2008 commented 3 years ago

multiwin example,click “New window” and then close, repeat it to reproduce.

maan2003 commented 3 years ago

reproduces on gtk and x11 backend

maan2003 commented 3 years ago

minimal druid-shell only example to reproduce the leak. Interestingly in this case, gtk backend leaks but x11 backend doesn't

psychon commented 2 years ago

I ran the minimal druid-shell only example with default features (thus gtk) under valgrind --tool=massif and clicked the window repeatedly. Resulting memory usage graph looks like this:

    MB
142.8^                                                                #       
     |                                                              @@#       
     |                                                      @     @@@@#::     
     |                                                    @@@:   :@@@@#::     
     |                                                   @@@@::  :@@@@#:::    
     |                                            @:    :@@@@:: ::@@@@#::::   
     |                                          @@@:::  :@@@@:::::@@@@#::::   
     |                                  @@:   ::@ @:: :::@@@@:::::@@@@#::::   
     |                                 @@ ::  @ @ @:: : :@@@@:::::@@@@#:::::  
     |                         :::   ::@@ :: :@ @ @:: : :@@@@:::::@@@@#:::::: 
     |                       @@: :: :: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::: 
     |               @:@    :@ : :  :: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@ 
     |              @@:@:  ::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@ 
     |            @@@@:@: :::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     |      :::  @@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     |     ::::: @@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     |    :::::::@@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     |   @:::::::@@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     |   @:::::::@@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
     | @@@:::::::@@ @@:@:::::@ : : ::: @@ ::::@ @ @:: : :@@@@:::::@@@@#:::::@:
   0 +----------------------------------------------------------------------->Gi
     0                                                                   21.94
This is what the memory usage looks like at the peak ``` -------------------------------------------------------------------------------- n time(i) total(B) useful-heap(B) extra-heap(B) stacks(B) -------------------------------------------------------------------------------- 78 21,011,024,069 149,726,232 130,695,518 19,030,714 0 87.29% (130,695,518B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc. ->40.29% (60,325,034B) 0x4970E18: g_malloc (gmem.c:106) | ->38.55% (57,723,592B) 0x4989110: g_slice_alloc (gslice.c:1072) | | ->28.52% (42,696,696B) 0x4989779: g_slice_alloc0 (gslice.c:1098) | | | ->17.59% (26,343,344B) 0x48F0A81: g_type_create_instance (gtype.c:1911) | | | | ->17.59% (26,343,344B) 0x48D6CBC: g_object_new_internal (gobject.c:1939) | | | | ->17.59% (26,332,624B) 0x48D81FC: g_object_new_with_properties (gobject.c:2108) | | | | | ->17.59% (26,332,624B) 0x48D8BB0: g_object_new (gobject.c:1779) | | | | | ->13.43% (20,110,320B) 0x4D15A2B: gtk_css_static_style_new_compute (gtkcssstaticstyle.c:191) | | | | | | ->13.43% (20,110,320B) 0x4D02B66: gtk_css_node_create_style (gtkcssnode.c:371) | | | | | | ->13.43% (20,110,320B) 0x4D02B66: gtk_css_node_real_update_style (gtkcssnode.c:425) | | | | | | ->13.43% (20,110,320B) 0x4D01886: gtk_css_node_ensure_style.part.0 (gtkcssnode.c:1007) | | | | | | ->10.07% (15,081,840B) 0x4D01B0C: gtk_css_node_ensure_style (gtkcssnode.c:992) | | | | | | | ->10.07% (15,081,840B) 0x4D01B0C: gtk_css_node_get_style (gtkcssnode.c:1033) | | | | | | | ->06.71% (10,046,880B) 0x4E69D0F: gtk_style_context_lookup_style (gtkstylecontext.c:494) | | | | | | | | ->06.71% (10,046,880B) 0x4E69D0F: _gtk_style_context_peek_property (gtkstylecontext.c:1619) | | | | | | | | ->03.36% (5,023,440B) 0x4F175D1: gtk_widget_update_alpha (gtkwidget.c:16098) | | | | | | | | | ->03.36% (5,023,440B) 0x4F17935: gtk_widget_realize (gtkwidget.c:5541) | | | | | | | | | ->03.36% (5,023,440B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | | | | | | ->03.36% (5,023,440B) 0x1EAB0B: ::realize (widget.rs:2467) | | | | | | | | | ->03.36% (5,023,440B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | | | | | | | ->03.36% (5,023,440B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | | | ->03.35% (5,022,720B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | | | ->03.35% (5,022,720B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | | | ->03.35% (5,022,720B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | | | ->03.35% (5,022,720B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | | | ->03.35% (5,022,720B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | | | ->03.35% (5,022,720B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | | | ->03.35% (5,022,720B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | | | ->03.35% (5,022,720B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | | | ->03.35% (5,022,720B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | | | ->03.35% (5,022,720B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | | | | | ->03.35% (5,022,720B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | | | ->03.35% (5,022,720B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | | | | | | | | | | | | | | ->00.00% (720B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | | | | | ->03.36% (5,023,440B) 0x4F217EE: update_opaque_region.part.0 (gtkwindow.c:7303) | | | | | | | | ->03.36% (5,023,440B) 0x4F222E5: update_opaque_region (gtkwindow.c:7218) | | | | | | | | ->03.36% (5,023,440B) 0x4F222E5: update_realized_window_properties (gtkwindow.c:7346) | | | | | | | | ->03.36% (5,023,440B) 0x4F222E5: update_realized_window_properties.constprop.0 (gtkwindow.c:7334) | | | | | | | | ->03.36% (5,023,440B) 0x4F268A3: gtk_window_realize (gtkwindow.c:7611) | | | | | | | | ->03.36% (5,023,440B) 0x4C8EC1F: gtk_application_window_real_realize (gtkapplicationwindow.c:681) | | | | | | | | ->03.36% (5,023,440B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | ->03.36% (5,023,440B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | | | | | | | ->03.36% (5,023,440B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | | | | | | | ->03.36% (5,023,440B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | ->03.36% (5,023,440B) 0x4F177E6: gtk_widget_realize (gtkwidget.c:5523) | | | | | | | | ->03.36% (5,023,440B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | | | | | ->03.36% (5,023,440B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | | | | | ->03.36% (5,023,440B) 0x1EAB0B: ::realize (widget.rs:2467) | | | | | | | | ->03.36% (5,023,440B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | | | | | | ->03.36% (5,023,440B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | | ->03.35% (5,022,720B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | | ->03.35% (5,022,720B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | | ->03.35% (5,022,720B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | | ->03.35% (5,022,720B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | | | | | | | | | | ->00.00% (720B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | | | ->03.36% (5,023,440B) 0x4E6B6B4: gtk_style_context_lookup_style (gtkstylecontext.c:494) | | | | | | | | ->03.36% (5,023,440B) 0x4E6B6B4: gtk_style_context_set_background (gtkstylecontext.c:2483) | | | | | | | | ->03.36% (5,023,440B) 0x4D221B1: gtk_drawing_area_realize (gtkdrawingarea.c:221) | | | | | | | | ->03.36% (5,023,440B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | ->03.36% (5,023,440B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | | | | | | | ->03.36% (5,023,440B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | | | | | | | ->03.36% (5,023,440B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | ->03.36% (5,023,440B) 0x4F177E6: gtk_widget_realize (gtkwidget.c:5523) | | | | | | | | ->03.36% (5,023,440B) 0x1EAB0B: ::realize (widget.rs:2467) | | | | | | | | ->03.36% (5,023,440B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | | | | | | ->03.36% (5,023,440B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | | ->03.35% (5,022,720B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | | ->03.35% (5,022,720B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | | ->03.35% (5,022,720B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | | ->03.35% (5,022,720B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | | ->03.35% (5,022,720B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | | ->03.35% (5,022,720B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | | ->03.35% (5,022,720B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | | ->03.35% (5,022,720B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | | ->03.35% (5,022,720B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | | | | | | | | | | ->00.00% (720B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | | | ->00.01% (11,520B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | ->03.36% (5,027,040B) 0x4D01858: gtk_css_node_ensure_style (gtkcssnode.c:992) | | | | | | | ->03.36% (5,027,040B) 0x4D01858: gtk_css_node_ensure_style.part.0 (gtkcssnode.c:1003) | | | | | | | ->03.36% (5,027,040B) 0x4D01B0C: gtk_css_node_ensure_style (gtkcssnode.c:992) | | | | | | | ->03.36% (5,027,040B) 0x4D01B0C: gtk_css_node_get_style (gtkcssnode.c:1033) | | | | | | | ->03.36% (5,023,440B) 0x4E69D0F: gtk_style_context_lookup_style (gtkstylecontext.c:494) | | | | | | | | ->03.36% (5,023,440B) 0x4E69D0F: _gtk_style_context_peek_property (gtkstylecontext.c:1619) | | | | | | | | ->03.36% (5,023,440B) 0x4F175D1: gtk_widget_update_alpha (gtkwidget.c:16098) | | | | | | | | ->03.36% (5,023,440B) 0x4F17935: gtk_widget_realize (gtkwidget.c:5541) | | | | | | | | ->03.36% (5,023,440B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | | | | | ->03.36% (5,023,440B) 0x1EAB0B: ::realize (widget.rs:2467) | | | | | | | | ->03.36% (5,023,440B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | | | | | | ->03.36% (5,023,440B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | | ->03.35% (5,022,720B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | | ->03.35% (5,022,720B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | | ->03.35% (5,022,720B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | | ->03.35% (5,022,720B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | | ->03.35% (5,022,720B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | | ->03.35% (5,022,720B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | | ->03.35% (5,022,720B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | | ->03.35% (5,022,720B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | | ->03.35% (5,022,720B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | | ->03.35% (5,022,720B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | | | | ->03.35% (5,022,720B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | | | | | | | | | | ->00.00% (720B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | | | ->00.00% (3,600B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | ->00.00% (1,440B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | ->01.64% (2,458,016B) 0x4CF5A8A: gtk_css_image_builtin_compute (gtkcssimagebuiltin.c:762) | | | | | | ->01.64% (2,458,016B) 0x4CFE658: gtk_css_value_image_compute (gtkcssimagevalue.c:50) | | | | | | ->01.64% (2,458,016B) 0x4D15AC7: gtk_css_static_style_compute_value (gtkcssstaticstyle.c:237) | | | | | | ->01.64% (2,458,016B) 0x4D00349: _gtk_css_lookup_resolve (gtkcsslookup.c:122) | | | | | | ->01.64% (2,457,928B) 0x4D15A4B: gtk_css_static_style_new_compute (gtkcssstaticstyle.c:195) | | | | | | | ->01.64% (2,457,928B) 0x4D02B66: gtk_css_node_create_style (gtkcssnode.c:371) | | | | | | | ->01.64% (2,457,928B) 0x4D02B66: gtk_css_node_real_update_style (gtkcssnode.c:425) | | | | | | | ->01.64% (2,457,928B) 0x4D01886: gtk_css_node_ensure_style.part.0 (gtkcssnode.c:1007) | | | | | | | ->01.23% (1,843,336B) 0x4D01B0C: gtk_css_node_ensure_style (gtkcssnode.c:992) | | | | | | | | ->01.23% (1,843,336B) 0x4D01B0C: gtk_css_node_get_style (gtkcssnode.c:1033) | | | | | | | | ->01.23% (1,843,336B) in 4 places, all below massif's threshold (1.00%) | | | | | | | | | | | | | | | ->00.41% (614,592B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | ->00.00% (88B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | ->01.28% (1,912,064B) 0x4D1E43A: gtk_css_widget_node_new (gtkcsswidgetnode.c:302) | | | | | | ->01.28% (1,912,064B) 0x4F05F6C: gtk_widget_init (gtkwidget.c:4472) | | | | | | ->01.28% (1,912,064B) 0x48F0AE2: g_type_create_instance (gtype.c:1923) | | | | | | ->01.28% (1,912,064B) 0x48D6CBC: g_object_new_internal (gobject.c:1939) | | | | | | ->01.28% (1,912,064B) in 3 places, all below massif's threshold (1.00%) | | | | | | | | | | | ->01.24% (1,852,224B) in 36 places, all below massif's threshold (1.00%) | | | | | | | | | ->00.01% (10,720B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | ->09.08% (13,600,072B) 0x48F0B54: g_type_create_instance (gtype.c:1901) | | | | ->09.04% (13,538,304B) 0x48D6CBC: g_object_new_internal (gobject.c:1939) | | | | | ->05.95% (8,905,792B) 0x48D8657: g_object_new_valist (gobject.c:2282) | | | | | | ->05.95% (8,905,432B) 0x48D8B88: g_object_new (gobject.c:1782) | | | | | | | ->03.54% (5,303,280B) 0x1EF92D: gtk::application_window::::new (application_window.rs:15) | | | | | | | | ->03.54% (5,303,280B) 0x1CCD89: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:288) | | | | | | | | ->03.54% (5,303,280B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | | ->03.54% (5,302,520B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | | ->03.54% (5,302,520B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | | ->03.54% (5,302,520B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | | ->03.54% (5,302,520B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | | ->03.54% (5,302,520B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | | ->03.54% (5,302,520B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | | ->03.54% (5,302,520B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | | ->03.54% (5,302,520B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | | ->03.54% (5,302,520B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | | ->03.54% (5,302,520B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | | | | ->03.54% (5,302,520B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | | ->03.54% (5,302,520B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | | | | ->03.54% (5,302,520B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | | | | | ->03.54% (5,302,520B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | | | | | ->03.54% (5,302,520B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | | | | | ->03.54% (5,302,520B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | | | | | ->03.54% (5,302,520B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | | | | | ->03.54% (5,302,520B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | | | | | ->03.54% (5,302,520B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | | | | | | | ->03.54% (5,302,520B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | | | | | | | ->03.54% (5,302,520B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | | | | | | | ->03.54% (5,302,520B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | | | | | | | ->03.54% (5,302,520B) 0x55C106C: g_application_run (gapplication.c:2569) | | | | | | | | | | | | | | | | | ->00.00% (760B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | | | ->01.36% (2,039,080B) in 18 places, all below massif's threshold (1.00%) | | | | | | | | | | | | | | | ->01.04% (1,563,072B) 0x4F1E247: gtk_window_constructed (gtkwindow.c:1758) | | | | | | | ->01.04% (1,563,072B) 0x48D6DA6: g_object_new_internal (gobject.c:1979) | | | | | | | ->01.04% (1,563,072B) 0x48D8657: g_object_new_valist (gobject.c:2282) | | | | | | | ->01.04% (1,563,072B) 0x48D8B88: g_object_new (gobject.c:1782) | | | | | | | ->01.04% (1,563,072B) 0x1EF92D: gtk::application_window::::new (application_window.rs:15) | | | | | | | ->01.04% (1,563,072B) 0x1CCD89: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:288) | | | | | | | ->01.04% (1,563,072B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | ->01.04% (1,562,848B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | ->01.04% (1,562,848B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | ->01.04% (1,562,848B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | ->01.04% (1,562,848B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | ->01.04% (1,562,848B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | ->01.04% (1,562,848B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | ->01.04% (1,562,848B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | ->01.04% (1,562,848B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | ->01.04% (1,562,848B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | ->01.04% (1,562,848B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | | | ->01.04% (1,562,848B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | ->01.04% (1,562,848B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | | | ->01.04% (1,562,848B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | | | | ->01.04% (1,562,848B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | | | | ->01.04% (1,562,848B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | | | | ->01.04% (1,562,848B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | | | | ->01.04% (1,562,848B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | | | | ->01.04% (1,562,848B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | | | | | | | | | | | ->00.00% (224B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | ->00.00% (360B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | ->03.09% (4,631,304B) 0x48D81FC: g_object_new_with_properties (gobject.c:2108) | | | | | | ->03.09% (4,631,304B) 0x48D8BB0: g_object_new (gobject.c:1779) | | | | | | ->01.42% (2,121,312B) 0x218D5C: gtk::auto::drawing_area::DrawingArea::new (drawing_area.rs:29) | | | | | | | ->01.42% (2,121,312B) 0x1CD37C: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:316) | | | | | | | ->01.42% (2,121,312B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | | ->01.42% (2,121,008B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | | | ->01.42% (2,121,008B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | | | ->01.42% (2,121,008B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | | | ->01.42% (2,121,008B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | | | ->01.42% (2,121,008B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | | | ->01.42% (2,121,008B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | | | ->01.42% (2,121,008B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | ->01.42% (2,121,008B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | | ->01.42% (2,121,008B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | | | ->01.42% (2,121,008B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | | | ->01.42% (2,121,008B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | | | ->01.42% (2,121,008B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | | | ->01.42% (2,121,008B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | | | | ->01.42% (2,121,008B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | | | | ->01.42% (2,121,008B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | | | | ->01.42% (2,121,008B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | | | | ->01.42% (2,121,008B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | | | | ->01.42% (2,121,008B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | | | | ->01.42% (2,121,008B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | | | | | | ->01.42% (2,121,008B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | | | | | | ->01.42% (2,121,008B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | | | | | | ->01.42% (2,121,008B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | | | | | | ->01.42% (2,121,008B) 0x55C106C: g_application_run (gapplication.c:2569) | | | | | | | | | | | | | | | ->00.00% (304B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | | | ->01.36% (2,031,160B) 0x4E68187: gtk_style_context_new_for_node (gtkstylecontext.c:574) | | | | | | | ->01.36% (2,031,160B) 0x4F171A8: gtk_widget_get_style_context (gtkwidget.c:16664) | | | | | | | ->01.36% (2,031,160B) in 3 places, all below massif's threshold (1.00%) | | | | | | | | | | | | | ->00.32% (478,832B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | | | ->00.00% (1,208B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | ->00.04% (61,768B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | ->01.83% (2,744,856B) 0x4D1DC9B: _gtk_css_value_alloc (gtkcssvalue.c:38) | | | | ->01.83% (2,744,856B) in 35 places, all below massif's threshold (1.00%) | | | | | | | ->00.01% (8,424B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->04.99% (7,477,288B) 0x48E82B1: handler_new (gsignal.c:686) | | | ->04.99% (7,477,288B) 0x48E82B1: g_signal_connect_data (gsignal.c:2594) | | | ->04.99% (7,477,288B) in 96 places, all below massif's threshold (1.00%) | | | | | ->02.68% (4,014,624B) 0x495751D: g_hash_table_new_full (ghash.c:1071) | | | ->02.68% (4,014,624B) in 81 places, all below massif's threshold (1.00%) | | | | | ->02.36% (3,534,984B) in 88 places, all below massif's threshold (1.00%) | | | ->01.74% (2,601,442B) in 72 places, all below massif's threshold (1.00%) | ->10.26% (15,366,000B) 0x4970E70: g_malloc0 (gmem.c:136) | ->07.97% (11,936,176B) 0x48D059B: g_closure_new_simple (gclosure.c:211) | | ->07.62% (11,405,328B) 0x48D1A61: g_cclosure_new (gclosure.c:976) | | | ->07.56% (11,319,000B) 0x48E83DC: g_signal_connect_data (gsignal.c:2601) | | | | ->07.56% (11,319,000B) in 85 places, all below massif's threshold (1.00%) | | | | | | | ->00.06% (86,328B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->00.35% (530,848B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->02.29% (3,429,824B) in 84 places, all below massif's threshold (1.00%) | ->09.88% (14,799,104B) 0x4970EB7: g_realloc (gmem.c:171) | ->02.88% (4,318,384B) in 45 places, all below massif's threshold (1.00%) | | | ->01.94% (2,903,376B) 0x494A230: g_data_set_internal (gdataset.c:471) | | ->01.45% (2,177,192B) 0x48DA0D2: g_object_weak_ref (gobject.c:3013) | | | ->01.45% (2,177,192B) in 3 places, all below massif's threshold (1.00%) | | | | | ->00.49% (726,184B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->01.79% (2,674,880B) 0x49566C9: g_hash_table_realloc_key_or_value_array (ghash.c:380) | | ->01.79% (2,674,880B) 0x49566C9: g_hash_table_setup_storage (ghash.c:589) | | ->01.79% (2,674,880B) 0x495755C: g_hash_table_new_full (ghash.c:1083) | | | ->01.79% (2,674,880B) in 81 places, all below massif's threshold (1.00%) | | | | | ->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->01.68% (2,511,424B) 0x49567FC: g_hash_table_realloc_key_or_value_array (ghash.c:380) | | ->01.68% (2,511,424B) 0x49567FC: realloc_arrays (ghash.c:722) | | ->01.68% (2,511,360B) 0x4956B15: g_hash_table_resize (ghash.c:875) | | | ->01.68% (2,511,360B) 0x49572EB: g_hash_table_maybe_resize (ghash.c:915) | | | ->01.68% (2,511,360B) 0x49572EB: g_hash_table_insert_node (ghash.c:1341) | | | ->01.40% (2,101,888B) 0x49580AF: g_hash_table_insert_internal (ghash.c:1600) | | | | ->01.40% (2,101,888B) 0x49580AF: g_hash_table_add (ghash.c:1689) | | | | ->01.40% (2,097,152B) 0x48E839E: handler_new (gsignal.c:704) | | | | | ->01.40% (2,097,152B) 0x48E839E: g_signal_connect_data (gsignal.c:2594) | | | | | ->01.40% (2,097,152B) 0x1DD55D: glib::signal::connect_raw (signal.rs:93) | | | | | | ->01.40% (2,097,152B) 0x1EA1DB: ::connect_focus_out_event (widget.rs:4036) | | | | | | ->01.40% (2,097,152B) 0x1CEC4F: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:766) | | | | | | ->01.40% (2,097,152B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | | ->01.40% (2,097,152B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | ->01.40% (2,097,152B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | ->01.40% (2,097,152B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | ->01.40% (2,097,152B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | ->01.40% (2,097,152B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | ->01.40% (2,097,152B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | ->01.40% (2,097,152B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | ->01.40% (2,097,152B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | ->01.40% (2,097,152B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | ->01.40% (2,097,152B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | ->01.40% (2,097,152B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | ->01.40% (2,097,152B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | ->01.40% (2,097,152B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | | ->01.40% (2,097,152B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | | ->01.40% (2,097,152B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | | ->01.40% (2,097,152B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | | ->01.40% (2,097,152B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | | ->01.40% (2,097,152B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | | ->01.40% (2,097,152B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | | | | ->01.40% (2,097,152B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | | | | ->01.40% (2,097,152B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | | | | ->01.40% (2,097,152B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | | | | ->01.40% (2,097,152B) 0x55C106C: g_application_run (gapplication.c:2569) | | | | | | | | | | | ->00.00% (0B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | ->00.00% (4,736B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | ->00.27% (409,472B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->00.00% (64B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->01.60% (2,391,040B) 0x48E20A3: g_bsearch_array_grow (gbsearcharray.h:209) | ->01.60% (2,391,040B) 0x48E20A3: g_bsearch_array_insert (gbsearcharray.h:238) | ->01.59% (2,386,944B) 0x48E2299: handler_list_ensure (gsignal.c:496) | | ->01.59% (2,386,944B) 0x48E2299: handler_insert (gsignal.c:784) | | ->01.59% (2,386,944B) 0x48E83FF: g_signal_connect_data (gsignal.c:2603) | | ->01.59% (2,386,944B) in 52 places, all below massif's threshold (1.00%) | | | ->00.00% (4,096B) in 1+ places, all below ms_print's threshold (01.00%) | ->07.64% (11,440,832B) 0x604395E: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->07.64% (11,440,832B) 0x6040426: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->04.66% (6,976,944B) 0x604145C: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->02.91% (4,362,176B) 0x6026E13: XGetWindowProperty (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | | ->02.91% (4,362,176B) 0x5414668: get_net_supporting_wm_check (gdkscreen-x11.c:1491) | | | ->02.91% (4,362,176B) 0x541487D: fetch_net_wm_check_window (gdkscreen-x11.c:1528) | | | ->02.91% (4,362,176B) 0x54162E7: gdk_x11_screen_supports_net_wm_hint (gdkscreen-x11.c:1608) | | | ->01.67% (2,493,920B) 0x5421669: gdk_x11_window_set_user_time (gdkwindow-x11.c:3633) | | | | ->01.67% (2,493,920B) 0x542194F: setup_toplevel_window (gdkwindow-x11.c:973) | | | | ->01.67% (2,493,920B) 0x5422098: _gdk_x11_display_create_window_impl (gdkwindow-x11.c:1168) | | | | ->01.67% (2,493,920B) 0x53ED79B: gdk_window_new (gdkwindow.c:1512) | | | | ->01.67% (2,493,920B) 0x4F26ACE: gtk_window_realize (gtkwindow.c:7492) | | | | ->01.67% (2,493,920B) 0x4C8EC1F: gtk_application_window_real_realize (gtkapplicationwindow.c:681) | | | | ->01.67% (2,493,920B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | ->01.67% (2,493,920B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | | | ->01.67% (2,493,920B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | | | ->01.67% (2,493,920B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | ->01.67% (2,493,920B) 0x4F177E6: gtk_widget_realize (gtkwidget.c:5523) | | | | ->01.67% (2,493,920B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | ->01.67% (2,493,920B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | | ->01.67% (2,493,920B) 0x1EAB0B: ::realize (widget.rs:2467) | | | | ->01.67% (2,493,920B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | | ->01.67% (2,493,920B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | ->01.66% (2,491,008B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | ->01.66% (2,491,008B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | ->01.66% (2,491,008B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | ->01.66% (2,491,008B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | ->01.66% (2,491,008B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | ->01.66% (2,491,008B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | ->01.66% (2,491,008B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | | | | ->00.00% (2,912B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | ->01.25% (1,868,256B) 0x541681F: _gdk_x11_screen_get_monitor_work_area (gdkscreen-x11.c:264) | | | ->01.25% (1,868,256B) 0x5413107: gdk_x11_monitor_get_workarea (gdkmonitor-x11.c:69) | | | ->01.25% (1,868,256B) 0x4F1F81F: gtk_window_guess_default_size (gtkwindow.c:6535) | | | ->01.25% (1,868,256B) 0x4F22E79: gtk_window_compute_configure_request_size (gtkwindow.c:9436) | | | ->01.25% (1,868,256B) 0x4F22E79: gtk_window_compute_configure_request (gtkwindow.c:9612) | | | ->01.25% (1,868,256B) 0x4F26DC9: gtk_window_realize (gtkwindow.c:7419) | | | ->01.25% (1,868,256B) 0x4C8EC1F: gtk_application_window_real_realize (gtkapplicationwindow.c:681) | | | ->01.25% (1,868,256B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | ->01.25% (1,868,256B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | | ->01.25% (1,868,256B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | | ->01.25% (1,868,256B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | ->01.25% (1,868,256B) 0x4F177E6: gtk_widget_realize (gtkwidget.c:5523) | | | ->01.25% (1,868,256B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | ->01.25% (1,868,256B) 0x4F179BC: gtk_widget_realize (gtkwidget.c:5517) | | | ->01.25% (1,868,256B) 0x1EAB0B: ::realize (widget.rs:2467) | | | ->01.25% (1,868,256B) 0x1CED83: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:795) | | | ->01.25% (1,868,256B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | ->01.25% (1,868,256B) 0x13B456: ::mouse_down (leak.rs:25) | | | ->01.25% (1,868,256B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | ->01.25% (1,868,256B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | ->01.25% (1,868,256B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | ->01.25% (1,868,256B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | ->01.25% (1,868,256B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | ->01.25% (1,868,256B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | ->01.25% (1,868,880B) 0x60258A8: XGetGeometry (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | | ->01.25% (1,868,880B) 0x541D78E: gdk_window_x11_get_geometry (gdkwindow-x11.c:3167) | | | ->01.25% (1,868,880B) 0x541D78E: gdk_window_x11_get_geometry (gdkwindow-x11.c:3148) | | | ->01.25% (1,868,880B) 0x53EDD2B: gdk_window_get_geometry (gdkwindow.c:6745) | | | ->01.25% (1,868,880B) 0x53D76E1: gdk_display_get_monitor_at_window (gdkdisplay.c:2722) | | | ->01.25% (1,868,880B) 0x4F1F80D: gtk_window_guess_default_size (gtkwindow.c:6531) | | | ->01.25% (1,868,880B) 0x4F22E79: gtk_window_compute_configure_request_size (gtkwindow.c:9436) | | | ->01.25% (1,868,880B) 0x4F22E79: gtk_window_compute_configure_request (gtkwindow.c:9612) | | | ->01.25% (1,868,880B) 0x4F2951C: gtk_window_move_resize (gtkwindow.c:9820) | | | ->01.25% (1,868,880B) 0x48D1908: _g_closure_invoke_va (gclosure.c:893) | | | ->01.25% (1,868,880B) 0x48EA2D8: g_signal_emit_valist (gsignal.c:3406) | | | ->01.25% (1,868,880B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | ->01.25% (1,868,880B) 0x4F24BC9: gtk_window_show (gtkwindow.c:6184) | | | ->01.25% (1,868,880B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | ->01.25% (1,868,880B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | | ->01.25% (1,868,880B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | | ->01.25% (1,868,880B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | ->01.25% (1,868,880B) 0x4F11415: gtk_widget_show (gtkwidget.c:4852) | | | ->01.25% (1,868,880B) 0x1EFCFB: ::show_all (widget.rs:2880) | | | ->01.25% (1,868,880B) 0x1D115D: druid_shell::backend::gtk::window::WindowHandle::show (window.rs:967) | | | ->01.25% (1,868,880B) 0x1ADBAA: druid_shell::window::WindowHandle::show (window.rs:181) | | | ->01.25% (1,868,672B) 0x13B48F: ::mouse_down (leak.rs:26) | | | | ->01.25% (1,868,672B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | ->01.25% (1,868,672B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | ->01.25% (1,868,672B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | ->01.25% (1,868,672B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | ->01.25% (1,868,672B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | ->01.25% (1,868,672B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | ->01.25% (1,868,672B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | | ->00.00% (208B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->00.50% (745,888B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->02.98% (4,463,888B) 0x6040E29: _XEventsQueued (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->02.98% (4,463,680B) 0x6043DC4: _XGetRequest (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->02.98% (4,463,680B) 0x603A679: XSendEvent (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->02.98% (4,463,680B) 0x603F4DD: XWithdrawWindow (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->02.98% (4,463,680B) 0x54203AC: gdk_window_x11_withdraw (gdkwindow-x11.c:1792) | | ->02.98% (4,463,680B) 0x54203AC: gdk_window_x11_withdraw (gdkwindow-x11.c:1779) | | ->02.98% (4,463,680B) 0x53F041F: gdk_window_withdraw (gdkwindow.c:5782) | | ->02.98% (4,463,680B) 0x4F1FE2C: gtk_window_unmap (gtkwindow.c:6426) | | ->02.98% (4,463,680B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | ->02.98% (4,463,680B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | ->02.98% (4,463,680B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | ->02.98% (4,463,680B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | ->02.98% (4,463,680B) 0x4F08FB3: gtk_widget_unmap (gtkwidget.c:5085) | | ->02.98% (4,463,680B) 0x4F1F06E: gtk_window_hide (gtkwindow.c:6221) | | ->02.98% (4,463,680B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | ->02.98% (4,463,680B) 0x48E3794: signal_emit_unlocked_R (gsignal.c:3672) | | ->02.98% (4,463,680B) 0x48E9F50: g_signal_emit_valist (gsignal.c:3497) | | ->02.98% (4,463,680B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | ->02.98% (4,463,680B) 0x4F115F9: gtk_widget_hide (gtkwidget.c:4953) | | ->02.98% (4,463,680B) 0x4F11826: gtk_widget_dispose (gtkwidget.c:12157) | | ->02.98% (4,463,680B) 0x4F24E77: gtk_window_dispose (gtkwindow.c:3167) | | ->02.98% (4,463,680B) 0x4C8E3EA: gtk_application_window_dispose (gtkapplicationwindow.c:804) | | ->02.98% (4,463,680B) 0x48D7AE8: g_object_run_dispose (gobject.c:1232) | | ->02.98% (4,463,680B) 0x4DBE36E: gtk_main_do_event (gtkmain.c:1824) | | ->02.98% (4,463,680B) 0x4DBE36E: gtk_main_do_event (gtkmain.c:1691) | | ->02.98% (4,463,680B) 0x4F1E526: send_delete_event (gtkwindow.c:1332) | | ->02.98% (4,463,680B) 0x53CDDF8: gdk_threads_dispatch (gdk.c:769) | | ->02.98% (4,463,680B) 0x496ABE3: g_main_dispatch (gmain.c:3381) | | ->02.98% (4,463,680B) 0x496ABE3: g_main_context_dispatch (gmain.c:4099) | | ->02.98% (4,463,680B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | ->02.98% (4,463,680B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | ->00.00% (208B) in 1+ places, all below ms_print's threshold (01.00%) | ->07.05% (10,560,416B) 0x48F0C29: g_type_create_instance (gtype.c:1907) | ->07.04% (10,546,432B) 0x48D6CBC: g_object_new_internal (gobject.c:1939) | | ->04.93% (7,377,856B) 0x48D8657: g_object_new_valist (gobject.c:2282) | | | ->04.93% (7,377,552B) 0x48D8B88: g_object_new (gobject.c:1782) | | | | ->03.13% (4,689,216B) 0x1EF92D: gtk::application_window::::new (application_window.rs:15) | | | | | ->03.13% (4,689,216B) 0x1CCD89: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:288) | | | | | ->03.13% (4,689,216B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | | ->03.13% (4,688,544B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | | ->03.13% (4,688,544B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | | ->03.13% (4,688,544B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | | ->03.13% (4,688,544B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | | ->03.13% (4,688,544B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | | ->03.13% (4,688,544B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | | ->03.13% (4,688,544B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | | ->03.13% (4,688,544B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | | ->03.13% (4,688,544B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | | ->03.13% (4,688,544B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | | ->03.13% (4,688,544B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | | ->03.13% (4,688,544B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | | ->03.13% (4,688,544B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | | ->03.13% (4,688,544B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | | ->03.13% (4,688,544B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | | ->03.13% (4,688,544B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | | ->03.13% (4,688,544B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | | ->03.13% (4,688,544B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | | ->03.13% (4,688,544B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | | | | ->03.13% (4,688,544B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | | | | ->03.13% (4,688,544B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | | | | ->03.13% (4,688,544B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | | | | ->03.13% (4,688,544B) 0x55C106C: g_application_run (gapplication.c:2569) | | | | | | ->03.13% (4,688,544B) 0x1B1468: ::run_with_args (application.rs:30) | | | | | | ->03.13% (4,688,544B) 0x1B155A: ::run (application.rs:23) | | | | | | ->03.13% (4,688,544B) 0x1A658D: druid_shell::backend::gtk::application::Application::run (application.rs:63) | | | | | | | | | | | ->00.00% (672B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | | | ->01.80% (2,688,336B) in 19 places, all below massif's threshold (1.00%) | | | | | | | ->00.00% (304B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->02.12% (3,167,584B) 0x48D81FC: g_object_new_with_properties (gobject.c:2108) | | | ->02.12% (3,167,584B) 0x48D8BB0: g_object_new (gobject.c:1779) | | | ->01.12% (1,674,720B) 0x218D5C: gtk::auto::drawing_area::DrawingArea::new (drawing_area.rs:29) | | | | ->01.12% (1,674,720B) 0x1CD37C: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:316) | | | | ->01.12% (1,674,720B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | | | ->01.12% (1,674,480B) 0x13B456: ::mouse_down (leak.rs:25) | | | | | ->01.12% (1,674,480B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | | | ->01.12% (1,674,480B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | | | ->01.12% (1,674,480B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | | | ->01.12% (1,674,480B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | | | ->01.12% (1,674,480B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | | | ->01.12% (1,674,480B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | | | ->01.12% (1,674,480B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | | | ->01.12% (1,674,480B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | | | ->01.12% (1,674,480B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | | | ->01.12% (1,674,480B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | | | ->01.12% (1,674,480B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | | | ->01.12% (1,674,480B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | | | ->01.12% (1,674,480B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | | | ->01.12% (1,674,480B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | | | ->01.12% (1,674,480B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | | | ->01.12% (1,674,480B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | | | ->01.12% (1,674,480B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | | | ->01.12% (1,674,480B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | | | ->01.12% (1,674,480B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | | | ->01.12% (1,674,480B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | | | ->01.12% (1,674,480B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | | | ->01.12% (1,674,480B) 0x55C106C: g_application_run (gapplication.c:2569) | | | | | ->01.12% (1,674,480B) 0x1B1468: ::run_with_args (application.rs:30) | | | | | ->01.12% (1,674,480B) 0x1B155A: ::run (application.rs:23) | | | | | ->01.12% (1,674,480B) 0x1A658D: druid_shell::backend::gtk::application::Application::run (application.rs:63) | | | | | | | | | ->00.00% (240B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | | | ->01.00% (1,492,864B) in 1+ places, all below ms_print's threshold (01.00%) | | | | | ->00.00% (992B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->00.01% (13,984B) in 1+ places, all below ms_print's threshold (01.00%) | ->04.35% (6,510,016B) 0x48D0602: g_closure_new_simple (gclosure.c:215) | ->04.15% (6,221,088B) 0x48D1A61: g_cclosure_new (gclosure.c:976) | | ->04.12% (6,174,000B) 0x48E83DC: g_signal_connect_data (gsignal.c:2601) | | | ->04.12% (6,174,000B) in 85 places, all below massif's threshold (1.00%) | | | | | ->00.03% (47,088B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->00.19% (288,928B) in 1+ places, all below ms_print's threshold (01.00%) | ->02.90% (4,340,928B) 0x48D066E: g_closure_new_simple (gclosure.c:216) | ->02.77% (4,147,392B) 0x48D1A61: g_cclosure_new (gclosure.c:976) | | ->02.75% (4,116,000B) 0x48E83DC: g_signal_connect_data (gsignal.c:2601) | | | ->02.75% (4,116,000B) in 85 places, all below massif's threshold (1.00%) | | | | | ->00.02% (31,392B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->00.13% (193,536B) in 1+ places, all below ms_print's threshold (01.00%) | ->01.78% (2,660,704B) 0x1A6AEB: alloc::alloc::alloc (alloc.rs:86) | ->01.78% (2,660,704B) 0x1A6B76: alloc::alloc::Global::alloc_impl (alloc.rs:166) | ->01.78% (2,660,704B) 0x1A6D99: ::allocate (alloc.rs:226) | ->01.78% (2,660,704B) 0x1A6A4C: alloc::alloc::exchange_malloc (alloc.rs:316) | ->01.38% (2,065,488B) 0x1A8E7A: alloc::sync::Arc::new (sync.rs:345) | | ->01.38% (2,065,488B) 0x1CE096: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:380) | | ->01.38% (2,065,488B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521) | | ->01.38% (2,065,192B) 0x13B456: ::mouse_down (leak.rs:25) | | | ->01.38% (2,065,192B) 0x1B554F: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}}::{{closure}} (window.rs:579) | | | ->01.38% (2,065,192B) 0x1C3742: druid_shell::backend::gtk::window::WindowState::with_handler_and_dont_check_the_other_borrows (window.rs:833) | | | ->01.38% (2,065,192B) 0x1B87AA: druid_shell::backend::gtk::window::WindowState::with_handler (window.rs:821) | | | ->01.38% (2,065,192B) 0x1B560A: druid_shell::backend::gtk::window::WindowBuilder::build::{{closure}} (window.rs:561) | | | ->01.38% (2,065,192B) 0x1D451B: ::connect_button_press_event::button_press_event_trampoline (widget.rs:3180) | | | ->01.38% (2,065,192B) 0x4F5DEA6: _gtk_marshal_BOOLEAN__BOXED (gtkmarshalers.c:83) | | | ->01.38% (2,065,192B) 0x48D16DE: g_closure_invoke (gclosure.c:830) | | | ->01.38% (2,065,192B) 0x48E3B35: signal_emit_unlocked_R (gsignal.c:3742) | | | ->01.38% (2,065,192B) 0x48E9ABA: g_signal_emit_valist (gsignal.c:3507) | | | ->01.38% (2,065,192B) 0x48EA4FE: g_signal_emit (gsignal.c:3553) | | | ->01.38% (2,065,192B) 0x4F07B93: gtk_widget_event_internal.part.0 (gtkwidget.c:7812) | | | ->01.38% (2,065,192B) 0x4DBC7DF: propagate_event_up (gtkmain.c:2598) | | | ->01.38% (2,065,192B) 0x4DBC7DF: propagate_event (gtkmain.c:2701) | | | ->01.38% (2,065,192B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1921) | | | ->01.38% (2,065,192B) 0x4DBE29C: gtk_main_do_event (gtkmain.c:1691) | | | ->01.38% (2,065,192B) 0x53D96A4: _gdk_event_emit (gdkevents.c:73) | | | ->01.38% (2,065,192B) 0x540CD71: gdk_event_source_dispatch (gdkeventsource.c:367) | | | ->01.38% (2,065,192B) 0x496ACDA: g_main_dispatch (gmain.c:3381) | | | ->01.38% (2,065,192B) 0x496ACDA: g_main_context_dispatch (gmain.c:4099) | | | ->01.38% (2,065,192B) 0x496AF87: g_main_context_iterate.constprop.0 (gmain.c:4175) | | | ->01.38% (2,065,192B) 0x496B03E: g_main_context_iteration (gmain.c:4240) | | | ->01.38% (2,065,192B) 0x55C106C: g_application_run (gapplication.c:2569) | | | ->01.38% (2,065,192B) 0x1B1468: ::run_with_args (application.rs:30) | | | ->01.38% (2,065,192B) 0x1B155A: ::run (application.rs:23) | | | ->01.38% (2,065,192B) 0x1A658D: druid_shell::backend::gtk::application::Application::run (application.rs:63) | | | | | ->00.00% (296B) in 1+ places, all below ms_print's threshold (01.00%) | | | ->00.40% (595,216B) in 1+ places, all below ms_print's threshold (01.00%) | ->01.63% (2,439,740B) in 581 places, all below massif's threshold (1.00%) | ->01.50% (2,252,744B) 0x48F0BBD: g_type_create_instance (gtype.c:1907) ->01.48% (2,211,952B) 0x48D6CBC: g_object_new_internal (gobject.c:1939) | ->01.48% (2,211,952B) in 3 places, all below massif's threshold (1.00%) | ->00.03% (40,792B) in 1+ places, all below ms_print's threshold (01.00%) ```

I'd say that the above indicates that druid-shell is leaking gtk widgets. 20 MB for GtkCssStyle instances seems excessive. 5 MB for ApplicationWindow instances also seems suspicious... And another 2 MB for DrawingArea instances.

These 11 MB look like a bug somwhere, but I am not sure where (yay for x11 being asynchronous): ``` ->07.64% (11,440,832B) 0x604395E: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->07.64% (11,440,832B) 0x6040426: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->04.66% (6,976,944B) 0x604145C: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->02.91% (4,362,176B) 0x6026E13: XGetWindowProperty (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | | ->02.91% (4,362,176B) 0x5414668: get_net_supporting_wm_check (gdkscreen-x11.c:1491) | | | ->02.91% (4,362,176B) 0x541487D: fetch_net_wm_check_window (gdkscreen-x11.c:1528) | | | ->02.91% (4,362,176B) 0x54162E7: gdk_x11_screen_supports_net_wm_hint (gdkscreen-x11.c:1608) ``` I re-ran this with `GDK_SYNCHRONIZE=1` in the env and the above did not really become clearer: ``` ->15.47% (11,445,824B) 0x604395E: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->15.47% (11,445,824B) 0x6040426: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->15.47% (11,445,824B) 0x604145C: _XReply (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | ->15.47% (11,440,416B) 0x603CCCA: XSync (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->15.47% (11,440,416B) 0x603CD6A: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) | | ->06.75% (4,992,208B) 0x601FEE1: XDestroyWindow (in /usr/lib/x86_64-linux-gnu/libX11.so.6.4.0) ``` `XDestroyWindow` gets a reply (must be an X11 error) that is never freed?!? The other half traces to `XChangeProperty`.... dunno.

The following seems like a hint at where the leak is coming from. An Arc that is never freed (but it could also be that this dump is just taken at a bad moment, but that means at most 2k windows being open. Dunno if 2 MB / 2k = 2 KB per window is realistic.)

->01.78% (2,660,704B) 0x1A6AEB: alloc::alloc::alloc (alloc.rs:86)
| ->01.78% (2,660,704B) 0x1A6B76: alloc::alloc::Global::alloc_impl (alloc.rs:166)
|   ->01.78% (2,660,704B) 0x1A6D99: <alloc::alloc::Global as core::alloc::Allocator>::allocate (alloc.rs:226)
|     ->01.78% (2,660,704B) 0x1A6A4C: alloc::alloc::exchange_malloc (alloc.rs:316)
|       ->01.38% (2,065,488B) 0x1A8E7A: alloc::sync::Arc<T>::new (sync.rs:345)
|       | ->01.38% (2,065,488B) 0x1CE096: druid_shell::backend::gtk::window::WindowBuilder::build (window.rs:380)
|       |   ->01.38% (2,065,488B) 0x1ADD64: druid_shell::window::WindowBuilder::build (window.rs:521)

The line number is let win_state = Arc::new(state);. Not really that helpful.... Well, actually: https://github.com/linebender/druid/blob/3790463cf4e724719dc0c1867afe59c3f2d22b3b/druid-shell/src/backend/gtk/window.rs#L380-L389 This is by design?! WindowState instances may only be destroyed during shutdown?

maan2003 commented 2 years ago

This is by design?! WindowState instances may only be destroyed during shutdown?

I think it is just accidental, WindowState should be destroyed after closing the window.

psychon commented 2 years ago

WindowState should be destroyed after closing the window.

Sounds like the Arc should not be kept until shutdown on gtk_app(), but instead the delete_event on the window. Something like this:

        let keep_everything_alive = Option(Arc::clone(&win_state))`;
        win_state
            .window
            .connect_delete_event(clone!(handle => move |_widget, _ev| {
                if let Some(state) = handle.state.upgrade() {
                    state.with_handler(|h| h.request_close());
                    let closing = state.closing.get();
                    if closing { keep_everything_alive.take(); }
                    Inhibit(!closing)
                } else {
                    Inhibit(false)
                }
            }));
maan2003 commented 2 years ago

It was changed from window.connect_destroy to app.connect_shutdown in https://github.com/linebender/druid/commit/79a80df5a625f578b0fe5abab7e993b100eb538b

psychon commented 2 years ago

Yeah, well, great commit message. And that commit comes from #152 "Fix typo". So apparently this was only ever a typo...

maan2003 commented 2 years ago

Also, The comment says "ties a clone of Arc to the ApplicationWindow" not Application. So probably the commit was just a misunderstanding of semantics.