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

Re: custom model rows-reordered marshal



Torsten Schoenfeld <kaffeetisch gmx de> writes:
>
> Does this look good to you?

Pretty close.

> I wonder how many stack handling bugs like this still hide in our
> PPCODE sections.

Until I realized the plain CODE: ones should be ok I thought it could be
very scary, what with the gazillion callbacks that can get back to perl
from a gtk func.  But if it's only PPCODE then it might be merely a bit
of a pain :-)

>  		int n_columns = gtk_tree_model_get_n_columns (tree_model);
> +		/* extend the stack so it can handle 'n_columns' items in
> +		 * total.  the stack already contains 'items' elements so make
> +		 * room for 'n_clumns - items' more, move our local stack
> +		 * pointer forward to the new end, and update the global stack
> +		 * pointer.  this way, xsubs called by gtk_tree_model_get_value
> +		 * don't overwrite what we put on the stack. */
> +		EXTEND (SP, n_columns - items);

gtk_tree_model_get_n_columns can callback on a custom model, so I think
an SPAGAIN.

--- GtkTreeModel.xs	08 Sep 2008 10:47:39 +1000	1.60
+++ GtkTreeModel.xs	08 Sep 2008 10:49:28 +1000	
@@ -1163,6 +1163,7 @@
 		 * pointer forward to the new end, and update the global stack
 		 * pointer.  this way, xsubs called by gtk_tree_model_get_value
 		 * don't overwrite what we put on the stack. */
+		SPAGAIN;
 		EXTEND (SP, n_columns - items);
 		SP += n_columns - items;
 		PUTBACK;
-- 
The sigfile one-line movie reviews series:
"Spotswood" -- the greatest film Anthony Hopkins ever made in Spotswood.


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