TreeView stack



A couple more probable stack gremlins in TreeView.  The tooltip one is
pretty clear.  The column get_size depends on how that func is
implemented, but looking at the code of 2.12/14 it calls its renderers
(as opposed to returning pre-computed size).

--- GtkTreeView.xs      08 Oct 2008 09:22:12 +1100      1.49
+++ GtkTreeView.xs      08 Oct 2008 09:22:21 +1100      
@@ -899,8 +899,12 @@
        GtkTreePath *path = NULL;
        GtkTreeIter iter = {0, };
     PPCODE:
+       /* PUTBACK/SPAGAIN because gtk_tree_view_get_tooltip_context() calls
+          out to its model get_iter(), which may be perl */
+       PUTBACK;
        if (! gtk_tree_view_get_tooltip_context (tree_view, &x, &y, keyboard_tip, &model, &path, &iter))
                XSRETURN_EMPTY;
+       SPAGAIN;
        EXTEND (sp, 5);
        PUSHs (sv_2mortal (newSViv (x)));
        PUSHs (sv_2mortal (newSViv (y)));
--- GtkTreeViewColumn.xs        08 Oct 2008 09:22:56 +1100      1.32
+++ GtkTreeViewColumn.xs        08 Oct 2008 09:23:05 +1100      
@@ -360,7 +360,11 @@
        GdkRectangle cell_area = {0};
        gint x_offset = 0, y_offset = 0, width = 0, height = 0;
     PPCODE:
+       /* PUTBACK/SPAGAIN because gtk_tree_view_column_cell_get_size()
+          calls out to its renderers, which may be perl */
+       PUTBACK;
        gtk_tree_view_column_cell_get_size (tree_column, &cell_area, &x_offset, &y_offset, &width, &height);
+       SPAGAIN;
        EXTEND (sp, 5);
        PUSHs (sv_2mortal (newSViv (x_offset)));
        PUSHs (sv_2mortal (newSViv (y_offset)));

-- 
"It's too early."
"Mate, some of us have been up since 10:30!"


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