Re: gdk_pixbuf_loader_write and short files



"Matthias Clasen" <matthiasc poet de> writes: 
> Thats why I added retval as a condition in the following if, maybe you
> missed that.
> I was under the impression that gdk_pixbuf_loader_load_module would
> return false if it an error occurred, in addition to possibly
> setting error.

I did miss it, but it looks like load_module actually returns the
number of bytes handled so far or something.

> Speaking about GError. In the low mem tests of test-loaders, I encountered
> the interesting situation that the loader tries to use g_set_error to report
> an
> out-of-memory situation - and then g_set_error falls on its face because it
> tries to allocate some more memory for duplicating the message.
> 
> Is there anything that can be done about this ?
> Other than using a very short message like "OOM"...

We aren't trying to handle that kind of low memory - we're only
handling the case where you open a 200 MB file, and aren't really low
on memory for the general case. If malloc (100) is failing, gdk-pixbuf
and GTK will crash soon anyhow. We just want to recover from really
large mallocs.

Havoc





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