[Vala] Fw: Possibly, error in code generator





-------- Пересылаемое сообщение --------
11.12.07, 17:38, Ed Schouten (ed fxq nl):

* 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()'. ;-)
-------- Завершение пересылаемого сообщения --------


--
Здравствуйте.
С уважением,
Денис Черемисов.
--- Begin Message ---
* 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: pgpr344a0C0ep.pgp
Description: PGP signature

_______________________________________________
Vala-list mailing list
Vala-list gnome org
http://mail.gnome.org/mailman/listinfo/vala-list

--- End Message ---


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