Re: dynamic gtk_list_store - Sorry



On Mon, 14 Jun 2004 11:44:50 -0300
John Coppens <john jcoppens com> wrote:

On Mon, 14 Jun 2004 00:32:14 +0100
Tim Müller <zen18864 zen co uk> wrote:

  store = gtk_tree_view_get_model (view);
  gtk_tree_view_set_model (view, NULL);
  g_object_unref (store);

Tim,

I've done some more tracing, and the store's ref_count is incremented
when a row is added (see trace below). So it would be necessary to
remove all rows first, before unrefing the actual liststore. Is this
right?

I'm sorry for the confusion. I did find a ref_count of 2, but the culprit
wasn't adding a row, which unrefs it immediately, but apparently, a
size_request to the store increments it to 2 and leaves it there.

The resize_request comes from a call inside g_main_dispatch, and the
function incrementing the ref_count is gtk_tree_row_reference_new_proxy
from gtk_tree_view_dy_to_top_row.

This is way beyond my knowledge - though I suspect somewhere this should
be unreffed along the way. Help!

John
-----------------
Old value = 1
New value = 2
g_object_ref (_object=0x8223cd8) at gobject.c:1571
1571    in gobject.c

bt
#0  g_object_ref (_object=0x8223cd8) at gobject.c:1571
#1  0x40425074 in gtk_tree_row_reference_new_proxy (proxy=0x80fda98,
    model=0x8223cd8, path=0x821ba20) at gtktreemodel.c:1719
#2  0x4043bd67 in gtk_tree_view_dy_to_top_row (tree_view=0x80fda98)
    at gtktreeview.c:4601
#3  0x4043b64f in do_validate_rows (tree_view=0x80fda98) at
#gtktreeview.c:4458 4  0x4043b955 in validate_rows (tree_view=0x80fda98)
#at gtktreeview.c:4470 5  0x40435ea9 in gtk_tree_view_size_request
#(widget=0x80fda98,
    requisition=0x80fdab4) at gtktreeview.c:1600
#6  0x4071a614 in g_cclosure_marshal_VOID__BOXED (closure=0x80ba620,
    return_value=0x0, n_param_values=2, param_values=0xbffff150,
    invocation_hint=0xbffff048, marshal_data=0x40435e60) at gmarshal.c:566
#7  0x40705617 in g_type_class_meta_marshal (closure=0x80ba620,
    return_value=0x2, n_param_values=2, param_values=0xbffff150,
    invocation_hint=0x2, marshal_data=0x2) at gclosure.c:514
#8  0x407052a7 in g_closure_invoke (closure=0x80ba620, return_value=0x2,
    n_param_values=2, param_values=0x2, invocation_hint=0x2) at
gclosure.c:437
#9  0x40718f12 in signal_emit_unlocked_R (node=0x80ba680, detail=0,
    instance=0x80fda98, emission_return=0x0,
instance_and_params=0xbffff150)    at gsignal.c:2366
#10 0x407186a8 in g_signal_emit_valist (instance=0x80fda98, signal_id=0,
    detail=0,
    var_args=0xbffff2fc
"\217å6 ¬íN@\230Ú\017\b(óÿ¿\177£;@\230Ú\017\bìr\037à\001
#11 0x40718aa3 in g_signal_emit_by_name (instance=0x80fda98,
    detailed_signal=0x404c7af5 "size_request") at gsignal.c:2263
#12 0x403b9fe3 in do_size_request (widget=0x80fda98) at gtksizegroup.c:493
#13 0x403ba37f in _gtk_size_group_compute_requisition (widget=0x80fda98,
    requisition=0xbffff3f0) at gtksizegroup.c:682
#14 0x40459d7c in gtk_widget_size_request (widget=0x80fda98,
#requisition=0x2)
    at gtkwidget.c:2331
#15 0x4043aceb in validate_visible_area (tree_view=0x80fda98)
    at gtktreeview.c:4274
#16 0x4043ba7c in do_presize_handler (tree_view=0x80fda98)
    at gtktreeview.c:4509
#17 0x4043bad7 in presize_handler_callback (data=0x2) at
#gtktreeview.c:4520 18 0x407a6303 in g_idle_dispatch (source=0x8224c98,
#callback=0x1,
    user_data=0x2) at gmain.c:3750
#19 0x407a2eca in g_main_dispatch (context=0x80af770) at gmain.c:1895
#20 0x407a3fe8 in g_main_context_dispatch (context=0x80af770) at
#gmain.c:2441 21 0x407a431c in g_main_context_iterate (context=0x80af770,
#block=1,
    dispatch=1, self=0x80a0a48) at gmain.c:2522
#22 0x407a49d1 in g_main_loop_run (loop=0x8207ba0) at gmain.c:2726
#23 0x403734ef in gtk_main () at gtkmain.c:1093
#24 0x0804fbbb in main (argc=1, argv=0xbffff654) at main.c:92



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