Free'ing GtkImage / GtkPixbuf



Hello, 

I'm rather new to GTK+ programming (at least using C). 

I essentially have a window consisting of a menu with New/Open/Save/Quit
actions. When 'Open' is clicked it opens a GtkFileChooserDialog. I then
filter add a GtkFileFilter for images/*. When an image is selected I
create a GdkPixbuf and then a GtkImage using gtk_image_new_from_pixbuf.
I then add the image to an eventbox. When the eventbox is clicked I
flood the selected area. 

With 'New', at the moment all I'm doing is clearing the image.
Obviously, memory usage begins to sky-rocket each time New is used and i
load a new image. 

I was wondering how I could free the memory being used. With 'New' I've
tried using free in combination with gtk_widget_destroy and
g_object_unref, but all that seems to produce is a crash. 

-- 
Andrew Williamson <ajww shaw ca>


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