After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 130880 - GtkFileSelection memory leak
GtkFileSelection memory leak
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.4.x
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
Federico Mena Quintero
Depends on:
Blocks:
 
 
Reported: 2004-01-08 11:00 UTC by Alessandro Pirovano
Modified: 2007-01-24 19:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Alessandro Pirovano 2004-01-08 11:00:00 UTC
I executed the code below with memprof.
Pressing OK button in the file_selection_dialog force destruction of the
old and creation of a new one.
The allocated memory keeps growing as shown by memprof, as long as i keep
pressing the OK button.
This can be related to some memory allocated by the file_selection_dialog
code and not freed at dialog destruction.

#include <gtk/gtk.h>

int main(int argc, char *argv[])
{
 GtkWidget *dialog;
 char *pStr;
 int response;
 int end=0;
 
 gtk_init (&argc, &argv);
 while(!end)
 {
  dialog = gtk_file_selection_new ("Selezione file dati rotaia");
  if(dialog)
  {
   response = gtk_dialog_run (GTK_DIALOG (dialog));
   if (response == GTK_RESPONSE_OK)
   {
    pStr=(char *)gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
   }
   else
   {
    end=1;
   }
   gtk_widget_destroy (dialog);
  }
 }
}
Comment 1 Federico Mena Quintero 2004-02-10 20:09:34 UTC
Setting the priority to "Low" for all bugs related to GtkFileSelection.  This
has been deprecated in favor of GtkFileChooser.
Comment 2 Owen Taylor 2004-03-10 18:56:36 UTC
Moving back to a nearer milestone as a potential memory leak.
Comment 3 Federico Mena Quintero 2004-04-14 19:28:51 UTC
Upping priority to normal and pushing to 2.4.2; don't have time to debug it
right now.
Comment 4 Elijah Newren 2004-06-19 18:46:24 UTC
Mass changing gtk+ bugs with target milestone of 2.4.2 to target 2.4.4, as
Matthias said he was trying to do himself on IRC and was asking for help with. 
If you see this message, it means I was successful at fixing the borken-ness in
bugzilla :)  Sorry for the spam; just query on this message and delete all
emails you get with this message, since there will probably be a lot.
Comment 5 ahunter 2006-03-31 07:24:53 UTC
Leaks occurring under 2.6.4 do not seem to occur under 2.8.16.

Maybe this should be closed?
Comment 6 Matthias Clasen 2006-03-31 14:09:10 UTC
Thats odd, I can't think of any changes to the old file selector that would have happened between 2.6 and 2.8 to make it go away.
Comment 7 ahunter 2006-04-03 09:54:00 UTC
Necessarily, I also had later versions of dependent libraries i.e.

glib     2.6.4     2.8.6
atk      1.8.0     1.10.3
cairo    1.0.3     1.0.4
pango    1.8.1     1.10.4
gtk      2.6.4     2.8.16
Comment 8 Federico Mena Quintero 2007-01-24 19:07:43 UTC
Marking as obsolete.  The code has changed enough that we need to look for leaks afresh.