Re: oafd Leak fixes



Ali Abdin <aliabdin aucegypt edu> writes:

> Hello,
> 
> Thanks to the beautiful memprof tool, I've fixed two more memory leaks
> in oafd. This is not a serious memory leak as the last patch. This time
> the memory is leaked only upon oafd startup (as opposed to everytime you
> load the directory).
> 
> None the less, with this patch when I run 'memprof oafd' I get no leaks
> reported :) Patch attached below.
> 
> Does anyone by any chance know how to attach a process to memprof? I
> would like to track the memory usage of oafd over a long period of time
> (starting up/shutting down components) but unfortunately, if I try to
> run it from the command-line (using memprof, or LD_PRELOAD tricks)
> whenever I run nautilus or evolution it launches up its own oafd instead
> of using the one already started. Any clues?
> 
> Anyway, can I commit this patch?
> 

Feel free to commit. Feel free to commit more leak fixes right off and
send the patch afterwards if you keep doing leak checking; your leak
checking kicks ass! I suggest you try using Pavel's leak checker (in
the eazel-tools module). Since it's LD_PRELOAD-based, it should
automatically attach to oafd when oafd is run by nautilus or whatever.

Regards,

Maciej

> Regards,
> Ali
> 
> 
> ? leak-fix2.diff
> ? api-docs/man
> ? po/Makefile.in.in
> cvs server: Diffing .
> Index: ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/oaf/ChangeLog,v
> retrieving revision 1.126.2.12
> diff -u -r1.126.2.12 ChangeLog
> --- ChangeLog	2000/12/28 19:06:14	1.126.2.12
> +++ ChangeLog	2000/12/30 02:49:07
> @@ -1,3 +1,13 @@
> +2000-12-30  Ali Abdin  <aliabdin aucegypt edu>
> +
> +	We now save a whopping 28 bytes with this fix (according to
> +	memprof)
> +
> +	* oafd/od-utils.c (od_utils_load_xml_file): Free a leaked
> +	string.
> +
> +	* oafd/main.c (main): ditto.
> +
>  2000-12-28  Michael Meeks  <michael helixcode com>
>  
>  	* test/oaf-slay.tmpl: Reverse grep on type="shlib" so we don't
> cvs server: Diffing api-docs
> cvs server: Diffing api-docs/tmpl
> cvs server: Diffing docs
> cvs server: Diffing idl
> cvs server: Diffing liboaf
> cvs server: Diffing oafd
> Index: oafd/main.c
> ===================================================================
> RCS file: /cvs/gnome/oaf/oafd/main.c,v
> retrieving revision 1.22
> diff -u -r1.22 main.c
> --- oafd/main.c	2000/11/09 17:49:59	1.22
> +++ oafd/main.c	2000/12/30 02:49:08
> @@ -142,7 +142,8 @@
>                  if (config_file_od_source_dir) {
>  			g_string_append_c (real_od_source_dir, ':');
>  			g_string_append (real_od_source_dir,
> -					 config_file_od_source_dir);                        
> +					 config_file_od_source_dir);
> +			g_free (config_file_od_source_dir);
>                  }
>  		if (gnome_env_od_source_dir) {
>                          gnome_dirs = g_strsplit (gnome_env_od_source_dir, ":", -1);
> Index: oafd/od-utils.c
> ===================================================================
> RCS file: /cvs/gnome/oaf/oafd/od-utils.c,v
> retrieving revision 1.8.4.1
> diff -u -r1.8.4.1 od-utils.c
> --- oafd/od-utils.c	2000/11/25 23:25:31	1.8.4.1
> +++ oafd/od-utils.c	2000/12/30 02:49:08
> @@ -45,9 +45,11 @@
>                  g_warning (_("The OAF configuration file was not read "
>                               "successfully. Please, check it is valid in: %s"),
>                             oaf_config_file);
> +		g_free (oaf_config_file);
>                  return NULL;
>          }
>  
> +	g_free (oaf_config_file);
>          return doc;
>  }
>  
> cvs server: Diffing po
> cvs server: Diffing test
> cvs server: Diffing utils




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