On Fri, Sep 06, 2002 at 02:55:43AM +0100, Michael wrote: > >[root@mike bin]# ./gimp-1.3 > >using MMX: yes > >swapfile is: /big/tmp/gimpswap.30852 > >swap add filename: /big/tmp/gimpswap.30852/n[Invalid UTF-8] > >swapfile is still: (¹g@(¹g@/gimpswap.30852 > > I was just looking at the above text and suddenly realised that the path > had turned to garbage in the third g_print line which I had put into > base.c like this:- > > void > base_init (void) > { > gchar *swapfile; > gchar *path; > > #ifdef HAVE_ASM_MMX > use_mmx = use_mmx && (intel_cpu_features() & (1 << 23)) ? 1 : 0; > g_print ("using MMX: %s\n", use_mmx ? "yes" : "no"); > #endif > > toast_old_temp_files (); > > /* Add the swap file */ > if (base_config->swap_path == NULL) > base_config->swap_path = g_strdup (g_get_tmp_dir ()); > > swapfile = g_strdup_printf ("gimpswap.%lu", (unsigned long) getpid ()); > > path = g_build_filename (base_config->swap_path, swapfile, NULL); > > g_print ("swapfile is: %s\n", path); > > g_free (swapfile); > > tile_swap_add (path, NULL, NULL); > > g_free (path); ^^^^^^^^^^^^^^^ You free path here... > > paint_funcs_setup (); > > g_print ("swapfile is still: %s\n", path); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... but you try to use the it here. Don't do that. :) > } > > so for some reason the path is being messed up in the lines between my > two added g_prints. Any advice? Cheers, Malcolm