gtk-demo: Fix segfault in editable cells demo

The strings can be freed when edting the description column. This does
not work with constant strings.
This commit is contained in:
Benjamin Otte 2011-11-22 23:27:40 +01:00
parent 6d0499a500
commit 6a6af8464b

View File

@ -48,27 +48,27 @@ add_items (void)
g_return_if_fail (articles != NULL);
foo.number = 3;
foo.product = "bottles of coke";
foo.product = g_strdup ("bottles of coke");
foo.yummy = 20;
g_array_append_vals (articles, &foo, 1);
foo.number = 5;
foo.product = "packages of noodles";
foo.product = g_strdup ("packages of noodles");
foo.yummy = 50;
g_array_append_vals (articles, &foo, 1);
foo.number = 2;
foo.product = "packages of chocolate chip cookies";
foo.product = g_strdup ("packages of chocolate chip cookies");
foo.yummy = 90;
g_array_append_vals (articles, &foo, 1);
foo.number = 1;
foo.product = "can vanilla ice cream";
foo.product = g_strdup ("can vanilla ice cream");
foo.yummy = 60;
g_array_append_vals (articles, &foo, 1);
foo.number = 6;
foo.product = "eggs";
foo.product = g_strdup ("eggs");
foo.yummy = 10;
g_array_append_vals (articles, &foo, 1);
}