On Wed, May 13, 2009 at 9:11 AM, Jasper van de Gronde
Bob Jamison wrote:
> I must say, the title "Don't let Inkscape Crash" is probably
> the best title for a bug ever filed for IS.
> It is maybe dating me, but in the past, if a malloc() causes problems,
> it is because somebody has done something bad with a previously-
> allocated malloc() chunk.
Indeed, it seems odd to "fix" Inkscape by letting g_(try_)new fail silently,
possibly creating problems at a later date or masking previous problems...
Or did most of the code using g_new simply assume that it would return a
null pointer (handling it appropriately)?
Of course you have to test the returning pointer if this is NULL. But
g_new simply ABORTS the program.
The current problems occurs in pixbuf allocations where the calculated
dimensions are far from being realistic.
But g_new is also used in some filter codes where it allocates only
small chunks and so assumes that it is enough memory out there.
Unfortunately Inkscape can not handle situations where the allocation
(which reason does not matter) fails.