(sin asunto)

Juan Azabache Marroquín <[email protected]>
Newsgroups gmane.comp.gnome.mono.hispano
Message-ID <[email protected]>
Saludos a toda la lista-

Tengo una pequeña rutina que carga un icono del recurso y me esta lanzando el siguiente "Warning".

"(Prueba:9942): GdkPixbuf-WARNING **: GdkPixbufLoader finalized without calling gdk_pixbuf_loader_close() - this is not allowed. You must explicitly end the data stream to the loader before dropping the last reference."

El código funciona perfectamente, siempre y cuando le pase un nombre -existente- de una imagen del recurso. Sin mebargo cuando el nombre no existe, en la consola me muestra ese warning. 
Si bien es cierto el código esta controlado con un try-catch para evitar que la rutina se caiga y termine con un error, pero quisiera saber si hay alguna forma mas optima de controlar esto.

El código es el siguiente:

        public static Gtk.Image LoadIcon(string nameicon)
        {
            Gtk.Image image = new Gtk.Image();
            
            if ( (nameicon == "") || (nameicon == null) )
                return null;
            
            try
            {
                image.Pixbuf = Gdk.Pixbuf.LoadFromResource(string.Concat(nameicon,".png"));
                return image;
            }
            catch
            {
                if ( image.Pixbuf != null )
                {
                    image.Pixbuf.Dispose();
                }
                //En el -catch- trate de limpiar todo rastro de las variables pero aun así me sigue mostrando la advertencia.
                image.Pixbuf = null;
                image.Destroy();
                image.Dispose();
                image = null;
                return null;
            }
        }

Estoy trabajando con:
- Ubuntu 8.04 - Hardy Heron
- Mono 1.9.1
- gtk-sharp2 2.12
- gdk-sharp 2.12

Muchas gracias por su tiempo.

Atte.
Juan Azabache M.


_________________________________________________________________
Comparte hasta 500 fotos en un solo email con Windows Live
http://download.live.com/

_______________________________________________
Mono-hispano mailing list
[email protected]
https://listas.hispalinux.es/mailman/listinfo/mono-hispano
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.