[gtk-osx-users] Memory leaks after toplevel window is destroyed



Hi all,
Working on Bluefish port to OSX, using gtk+3.6.4, gtk-mac-integration 2.0.1 on MacOSX 10.8.4. I

When using gtk-osx, I noticed that after toplevel window is created with menubar and then destroyed, leaks 
shows large number of of memory leaks (typically ~1500, probably it depends on complexity of menubar), most 
likely related to the app menubar. Below is small excerpt from leaks output:

Leak: 0x7febae111ea0  size=128  zone: DefaultMallocZone_0x1061b6000   _GNSMenuItem  ObjC  
libgtkmacintegration.2.dylib
    0x06226e48 0x00000001 0x00000000 0x00000000     Hn".............
    0xae111d00 0x00007feb 0x06226e70 0x00000001     ........pn".....
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0xae112160 0x00007feb 0x00000000 0x00000000     `!..............
    0xae111ea0 0x00007feb 0x95804365 0x00007fff     ........eC......
    0x00000000 0x00000000 0x00000010 0x00000001     ................
    0xa8cbc6a0 0x00007feb 0xae111d50 0x00007feb     ........P.......
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    Call stack: [thread 0x7fff7b1ac180]: | start | main | gtk_main | g_main_loop_run | g_main_context_iterate 
| g_main_context_dispatch | g_main_dispatch | g_idle_dispatch | gdk_threads_dispatch | idle_call_activate | 
g_closure_invoke | g_cclosure_marshal_VOID__VOID | gtk_menu_item_activate | g_signal_emit | 
g_signal_emit_valist | _g_closure_invoke_va | g_type_class_meta_marshalv | g_cclosure_marshal_VOID__VOIDv | 
gtk_real_menu_item_activate | gtk_action_activate | _gtk_action_emit_activate | g_signal_emit | 
g_signal_emit_valist | signal_emit_unlocked_R | g_closure_invoke | g_cclosure_marshal_VOID__VOID | 
ui_new_window | bfwin_window_new | bfwin_show_main | gtkosx_application_set_menu_bar | 
cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | cocoa_menu_item_sync | 
cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | 
_objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc 
Leak: 0x7febae112610  size=128  zone: DefaultMallocZone_0x1061b6000   _GNSMenuItem  ObjC  
libgtkmacintegration.2.dylib
    0x06226e48 0x00000001 0x00000000 0x00000000     Hn".............
    0xae112e30 0x00007feb 0x06226e70 0x00000001     0.......pn".....
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0xae112610 0x00007feb 0x95804365 0x00007fff     .&......eC......
    0x00000000 0x00000000 0x00000010 0x00000001     ................
    0xace17f90 0x00007feb 0xae112bc0 0x00007feb     .........+......
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    Call stack: [thread 0x7fff7b1ac180]: | start | main | gtk_main | g_main_loop_run | g_main_context_iterate 
| g_main_context_dispatch | g_main_dispatch | g_idle_dispatch | gdk_threads_dispatch | idle_call_activate | 
g_closure_invoke | g_cclosure_marshal_VOID__VOID | gtk_menu_item_activate | g_signal_emit | 
g_signal_emit_valist | _g_closure_invoke_va | g_type_class_meta_marshalv | g_cclosure_marshal_VOID__VOIDv | 
gtk_real_menu_item_activate | gtk_action_activate | _gtk_action_emit_activate | g_signal_emit | 
g_signal_emit_valist | signal_emit_unlocked_R | g_closure_invoke | g_cclosure_marshal_VOID__VOID | 
ui_new_window | bfwin_window_new | bfwin_show_main | gtkosx_application_set_menu_bar | 
cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | cocoa_menu_item_sync | 
cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | 
cocoa_menu_item_sync | cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu |
 cocoa_menu_item_add_item | _objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc 
Leak: 0x7febae113080  size=128  zone: DefaultMallocZone_0x1061b6000   _GNSMenuItem  ObjC  
libgtkmacintegration.2.dylib
    0x06226e48 0x00000001 0x00000000 0x00000000     Hn".............
    0xae112fc0 0x00007feb 0x06226e70 0x00000001     ./......pn".....
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0xae113080 0x00007feb 0x95804365 0x00007fff     .0......eC......
    0x00000000 0x00000000 0x00000010 0x00000001     ................
    0xace17b40 0x00007feb 0xae113000 0x00007feb     @{.......0......
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    Call stack: [thread 0x7fff7b1ac180]: | start | main | gtk_main | g_main_loop_run | g_main_context_iterate 
| g_main_context_dispatch | g_main_dispatch | g_idle_dispatch | gdk_threads_dispatch | idle_call_activate | 
g_closure_invoke | g_cclosure_marshal_VOID__VOID | gtk_menu_item_activate | g_signal_emit | 
g_signal_emit_valist | _g_closure_invoke_va | g_type_class_meta_marshalv | g_cclosure_marshal_VOID__VOIDv | 
gtk_real_menu_item_activate | gtk_action_activate | _gtk_action_emit_activate | g_signal_emit | 
g_signal_emit_valist | signal_emit_unlocked_R | g_closure_invoke | g_cclosure_marshal_VOID__VOID | 
ui_new_window | bfwin_window_new | bfwin_show_main | gtkosx_application_set_menu_bar | 
cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | cocoa_menu_item_sync | 
cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | 
cocoa_menu_item_sync | cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu |
 cocoa_menu_item_add_item | _objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc 
Leak: 0x7febae1134c0  size=128  zone: DefaultMallocZone_0x1061b6000   _GNSMenuItem  ObjC  
libgtkmacintegration.2.dylib
    0x06226e48 0x00000001 0x00000000 0x00000000     Hn".............
    0xae113400 0x00007feb 0x06226e70 0x00000001     .4......pn".....
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    0xae1134c0 0x00007feb 0x95804365 0x00007fff     .4......eC......
    0x00000000 0x00000000 0x00000010 0x00000001     ................
    0xace17c60 0x00007feb 0xae113440 0x00007feb     `|       4      
    0x00000000 0x00000000 0x00000000 0x00000000     ................
    Call stack: [thread 0x7fff7b1ac180]: | start | main | gtk_main | g_main_loop_run | g_main_context_iterate 
| g_main_context_dispatch | g_main_dispatch | g_idle_dispatch | gdk_threads_dispatch | idle_call_activate | 
g_closure_invoke | g_cclosure_marshal_VOID__VOID | gtk_menu_item_activate | g_signal_emit | 
g_signal_emit_valist | _g_closure_invoke_va | g_type_class_meta_marshalv | g_cclosure_marshal_VOID__VOIDv | 
gtk_real_menu_item_activate | gtk_action_activate | _gtk_action_emit_activate | g_signal_emit | 
g_signal_emit_valist | signal_emit_unlocked_R | g_closure_invoke | g_cclosure_marshal_VOID__VOID | 
ui_new_window | bfwin_window_new | bfwin_show_main | gtkosx_application_set_menu_bar | 
cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | cocoa_menu_item_sync | 
cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu | cocoa_menu_item_add_item | 
cocoa_menu_item_sync | cocoa_menu_item_update_submenu | cocoa_menu_item_add_submenu |
 cocoa_menu_item_add_item | _objc_rootAllocWithZone | class_createInstance | calloc | malloc_zone_calloc 

Is this normal situation? Or there is something wrong with my code?

Is there a clean way to destroy the window with menubar without causing memory leaks? The description of 
gtkosxApplication seems to do not provide any hints...

Thank You in advance.
Andrius



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]