Re: [Gtk2forpascal-devel] Problem with PGdkPixbufLoader
Brought to you by:
mgaertner
|
From: Jeff P. <yet...@ya...> - 2004-06-08 03:09:08
|
> In the following program, the "if" block is exactly
> the same as the "else" block except that in the "if"
> block gdk_pixbuf_loader_get_pixbuf() is put into
> getImage() function.
Variables on the heap (global) are initialized to NIL;
but variables on the stack (local) are not initialized,
they usually contain random garbage from who-knows-what.
That is why you get the:
assertion `error == NULL || *error == NULL' failed
from the local "error" but not the global.
Try this...
function getImage(loader:PGdkPixbufLoader; var s:string):boolean;
var
error : pgerror;
begin
error:=nil; // <-- ADD THIS LINE !!!
result := gdk_pixbuf_loader_write(loader,@(s[1]),length(s),@error);
end;//getImage()
Hope this helps,
- Jeff
__________________________________
Do you Yahoo!?
Friends. Fun. Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/
|