From: Kouhei S. <ko...@co...> - 2008-03-31 15:11:07
|
Hi, In <dc3...@ma...> "[ruby-gnome2-devel-en] closing a GdkPixbufLoader ignoring errors" on Mon, 31 Mar 2008 00:13:16 +0200, "Guillaume Cottenceau" <gco...@gm...> wrote: > Quoting http://library.gnome.org/devel/gdk-pixbuf/unstable/GdkPixbufLoader.html#gdk-pixbuf-loader-close > : > > "If you're just cancelling a load rather than expecting it to be > finished, passing NULL for error to ignore it is reasonable." > > Current implementation doesn't allow for it: > > -=----=----=----=----=----=----=--- > static VALUE > loader_close(self) > VALUE self; > { > GError *error = NULL; > gboolean res; > > res = gdk_pixbuf_loader_close(_SELF(self), &error); > if(error) > RAISE_GERROR(error); > > return CBOOL2RVAL(res); > } > -=----=----=----=----=----=----=--- > > What is the correct rg2 idiom for doing that? Using #close(nil) sounds > pretty stupid, but then, what to do? Maybe #close_noerror but then the > principle of least surprise (guessing method names and ways to call > them) is pretty broken :/ Is it good enough to use rescue? begin pixbuf_loader.close rescue Gdk::PixbufError end It is clear for me. Thanks, -- kou |