Re: [Vala] Possibly, error in code generator



* Jürg Billeter <j bitron ch> wrote:
No, POSIX fclose() works like that. The reason is that closing the file
and releasing the allocated memory is the same operation, so the FILE
pointer gets invalid after calling fclose() and further use of the
pointer will lead to crashes. As written before, future versions of
valac won't allow to call close() manually for variables using automatic
memory management.

Indeed. Just setting the variable to `null' would be a more elegant
solution. That's what I did with the Curses bindings as well. There is
no `delwin()'. ;-)

-- 
 Ed Schouten <ed fxq nl>
 WWW: http://g-rave.nl/

Attachment: pgpgyGDY2trqV.pgp
Description: PGP signature



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