Invalid GtkTreeIter



I have a program that declares a number of GtkTreeIter's.  Recently the
prepending to the parent iter broke.  I found out that, in some cases,
the stamp to the iter's are negative just after the iter is declared.
This means the iter is invalid.  The following test program does the
same thing.

Why aren't all the stamps to the four iter's (a, b, c, and d) valid and
positive?


/* Test Program:  tstIters.c
 * Build Command:
 * gcc -Wall -g2 `pkg-config --cflags gtk+-2.0` `pkg-config --libs
gtk+-2.0` tstIters.c -o tstIters
 */
#include <stdio.h>
#include <glib/gprintf.h>
#include <gtk/gtk.h>

int main(int argc, char **argv) {
  GtkTreeIter a;
  GtkTreeIter b;
  GtkTreeIter c;
  GtkTreeIter d;

  g_printf("a.stamp={%d}\n", a.stamp);
  g_printf("b.stamp={%d}\n", b.stamp);
  g_printf("c.stamp={%d}\n", c.stamp);
  g_printf("d.stamp={%d}\n", d.stamp);

  return 0;
}


Output

$ ./tstIters
a.stamp={4196240}
b.stamp={496461664}
c.stamp={-565527112}
d.stamp={-565527128}
$ ./tstIters
a.stamp={4196240}
b.stamp={-873273504}
c.stamp={716436552}
d.stamp={716436536}
$ ./tstIters
a.stamp={4196240}
b.stamp={938256224}
c.stamp={-1622865320}
d.stamp={-1622865336}
$ ./tstIters
a.stamp={4196240}
b.stamp={1835186016}
c.stamp={-524655784}
d.stamp={-524655800}
$

Thanks,

dhk



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