Re: possible bug
- From: Brett Nash <nash nash nu>
- To: Jeffrey Goddard <moosewood mooseroot org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: possible bug
- Date: Fri, 3 Jan 2003 02:46:02 +1100
              while((row = mysql_fetch_row(result_set)) != NULL)
              {
                      some_other_string = row[0];
                      if(first_record_flag)
                      {
                              first_record_flag = FALSE;
                              somestring = some_other_string;
                      }
                      .
                      .
                      /* rest of tree loading stuff */
                      .
                      .
              }
Okay - somewhere down here you should have a call to:
        mysql_free_result();
        I'm betting your problems first occur sometime after that.
Basically mysql frees the string in row[0] when you are finished with
the results.  This is the same data used in some_other_string and
somestring.  Easy fix is to use:
        somestring = g_strdup(some_other_string);
        You will need to call: 
                g_free(somestring);
when you are finished with somestring.  
        This should fix your bug.
        Regards,
        nash
-- 
Brett Nash <nash nash nu>
Sometimes it's better to light a flamethrower than curse the darkness.
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]