1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>

* gnome-file-property-dialog.c (apply_metadata_change): Fix memory leak.

1999-02-22  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* gdesktop.c (desktop_reload_icons): Fix memory leak.

	* glayout.c (create_new_menu_from): Fix memory leak.
This commit is contained in:
Miguel de Icaza 1999-02-23 06:14:02 +00:00
parent 197cf5dcab
commit f1120801b6
5 changed files with 36 additions and 6 deletions

View File

@ -1,3 +1,7 @@
1999-02-23 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gnome-file-property-dialog.c (apply_metadata_change): Fix memory leak.
1999-02-22 Miguel de Icaza <miguel@nuclecu.unam.mx>
* gdesktop.c (desktop_reload_icons): Fix memory leak.

View File

@ -423,6 +423,10 @@ desktop_reload_icons (int user_pos, int xpos, int ypos)
full_name = g_concat_dir_and_file (desktop_directory, dirent->d_name);
fe = file_entry_from_file (full_name);
if (!fe){
g_free (full_name);
continue;
}
im = gicon_get_icon_for_file (desktop_directory, fe, FALSE);
file_entry_free (fe);
g_free (full_name);
@ -1056,6 +1060,10 @@ desktop_icon_info_open (DesktopIconInfo *dii)
filename = g_concat_dir_and_file (desktop_directory, dii->filename);
fe = file_entry_from_file (filename);
if (!fe){
message (1, _("Error"), "I could not fetch the information from the file");
return;
}
if (S_ISDIR (fe->buf.st_mode) || link_isdir (fe))
new_panel_at (filename);
@ -1650,6 +1658,8 @@ desktop_icon_info_new (char *filename, char *url, char *caption, int xpos, int y
full_name = g_concat_dir_and_file (desktop_directory, filename);
fe = file_entry_from_file (full_name);
if (!fe)
return NULL;
dii = g_new (DesktopIconInfo, 1);
dii->x = 0;

View File

@ -94,6 +94,19 @@ void free (void *ptr);
#include "util.h"
static gboolean
option_has_user (char *str)
{
if ((p = strstr (mnt->mnt_opts, "user")) != NULL){
if ((p - 2) >= str){
if (strncmp (p - 2, "nouser", 6) == 0)
return FALSE;
}
return TRUE;
}
return FALSE;
}
#ifdef MOUNTED_GETMNTENT1
/*
@ -116,7 +129,7 @@ is_block_device_mountable (char *devname)
return FALSE;
while ((mnt = getmntent (f))){
if (strstr (mnt->mnt_opts, "user")){
if (option_has_user (mnt->mt_opts)){
retval = g_strdup (mnt->mnt_dir);
break;
}
@ -156,7 +169,7 @@ get_mountable_devices (void)
return NULL;
while ((mnt = getmntent (f))){
if (strstr (mnt->mnt_opts, "user")){
if (option_has_user (mnt->mnt_opts)){
list = g_list_prepend (list, g_strdup (mnt->mnt_fsname));
break;
}

View File

@ -1268,7 +1268,9 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd)
if (!fpd->can_set_icon)
return 1;
/* And finally, we set the metadata on the icon filename */
text = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (fpd->button)); /*gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));*/
text = gnome_icon_entry_get_filename (GNOME_ICON_ENTRY (fpd->button));
/*gtk_entry_get_text (GTK_ENTRY (gnome_icon_entry_gtk_entry (GNOME_ICON_ENTRY (fpd->button))));*/
icon_name = gicon_get_filename_for_icon (fpd->im);
if (text) {
if (strcmp (text, icon_name))
@ -1284,6 +1286,7 @@ apply_metadata_change (GnomeFilePropertyDialog *fpd)
gnome_metadata_remove (fpd->file_name, "icon-filename");
*/
}
g_free (text);
}
/* I suppose we should only do this if we know there's been a change -- I'll try to figure it
* out later if it turns out to be important. */

View File

@ -530,7 +530,7 @@ create_regexp_actions (GtkWidget *menu, WPanel *panel,
/* Fill in the common part of the menus */
for (i = 0; i < 5; i++)
for (i = 0; a_uiinfo [i].type != GNOME_APP_UI_ENDOFINFO; i++)
a_uiinfo[i].user_data = closure;
fill_menu (GTK_MENU_SHELL (menu), a_uiinfo, insert_pos);