title: Gtk-warning: Invalid text buffer iterator when writing to the same text view multiple times
body: <p>This below function gets called every second and tries to write the total_successful_connects.
  It works sometimes but I get the above error and program crashes.</p>
  
  <p>gtk_text_buffer_set_text() will delete the previous buffer content. Does it not validate the iterator? </p>
  
  <p>If not, What should I do to validate the iterator?</p>
  
  <pre><code>void display_status()
  {
      char output_str[100];
  
      sprintf(output_str, "%u", stats-&gt;total_successful_connects);
      gtk_text_buffer_set_text(
          config-&gt;text_buffer,
          output_str, strlen(output_str));
  
  }
  </code></pre>
  
  <p>I have initialized config->textbuffer once during start up by calling gtk_text_view_get_buffer(my_text_view)</p>
  
  <p>I am using gtk+ 2</p>
  
  <p>Error in detail:</p>
  
  <pre><code>(gedit:7793): Gtk-WARNING **: Invalid text buffer iterator: either the iterator is uninitialized, or the characters/pixbufs/widgets in the buffer have been modified since the iterator was created.
  You must use marks, character numbers, or line numbers to preserve a position across buffer modifications.
  You can apply tags and insert marks without invalidating your iterators,
  but any mutation that affects 'indexable' buffer contents (contents that can be referred to by character offset)
  will invalidate all outstanding iterators
  </code></pre>