Re: smproxy/save.c



Ray Strode wrote:

Hi,

   const gchar *path;
   ...
   ...

   path = getenv ("SM_SAVE_DIR");
   if (!path)
     path = gnome_util_home_file (NULL); (needs to be freed)
   if (!path)
     path = g_get_home_dir ();
   if (!path)
     path = getenv ("HOME");
   if (!path)
     path = ".";

But I can't see how to sanely free this without redoing the whole
function since it's assigned using different methods where some allocate
new memory and others don't and the variable is declared as const so the
compiler will complain loudly if you try to free it...
I don't think any of those functions are likely to return different
values during the lifetime of the program.  I'd make the variable
static, and take some of the lines out, because those functions overlap
in functionality.

Maybe just do..
static const gchar *path = NULL;

if (!path)
   path = (const gchar *) g_getenv ("SM_SAVE_DIR");

if (!path)
   path = (const gchar *) g_build_filename (g_get_home_dir (),
".gnome2", NULL);


I think this is a reasonable alternative, in that gnome-smproxy is only run once. Having to allocate a static memory for the entire session does not seem like an
overkill.

Is this piece of code worth bothering to fix? It seems FC3 doesn't even
use the session proxy at all. I don't have any ~/.gnome2/.gnome-smproxy-
* files at least...
Probably not.  The smproxy stuff is just so pre-xsmp applications can
work with gnome-session.  My thoughts are that those applications aren't
integrated with the desktop in so many other ways that spending time so
that they can restore their state on login doesn't really seem useful.

Though I think Mozilla/firefox is an important apps that does not support xsmp and I don't think the rfe, https://bugzilla.mozilla.org/show_bug.cgi?id=93789, is going to fix any time soon. So, in that sense gnome-smproxy is still important!


-Ghee


--Ray Strode

_______________________________________________
desktop-devel-list mailing list
desktop-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/desktop-devel-list





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