Re: [Vala] Question about Gtk.Builder



W dniu 10 października 2010 00:04 użytkownik Aleksander Wabik <
alex wabik gmail com> napisał:

Why do you bother about closing mainwindow ? In 99% of cases, your
application will end when you close (really, not miniminzing) your
mainwindow. And here that is the case.
Then, OS will reclaim resources ending the application ; so, Why bother ?
Destroying mainwindow is a very special case.


That's why I don't regard managed langues and environments (C# and Java),
because they made programmer a lazy person. C# programmers don't bother
about memory, don't bother about CPU time, generally don't bother about
anything. I'm a C programmer and I used to bother about anything, because I
always assume, that  it's better to do things on my own and don't assume,
that someone/something will do it for me.


Not bothering about the cleanup when closing application is a very,
very bad idea. The system will reclaim all resources, but if you want
to ever use valgrind or maybe in the future there comes up the idea of
some reusing actual code or extending the application with some new
features, you get total mess. Not to mention that there ARE systems
where the kernel will not reclaim memory and you have a leak (but ATM
we don't have glib port to BREW, do we?)

As for the OP's question, I must say that I don't know, but the
question looks perfectly reasonable to me.


I investigated generated C code, toplevel window must be destroyed manually
with destroy() method before destroying Gtk.Builder object holding this
window. Where to report this "bug" in example? On Bugzilla?


best regards,


As far as I've seen for now ; someone correct me if I'm wrong.

2010/10/8 Tomasz Jankowski <tomcioj gmail com>

Hello!

I found at Vala's home page sample code showing how to use Gtk.Builder (

http://live.gnome.org/Vala/GTKSample#Loading_User_Interface_from_XML_File
).
According to GTK+ API reference for C, programmer is responsible for
destroying toplevel window. Sample's author forgot about cleaning up
or omitted it deliberately because Vala will destroy free all resources
for
me?

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




--
Dupuy Mathieu
Epitech 2011.


--
Mój klucz publiczny o identyfikatorze 1024D/E12C5A4C znajduje się na
serwerze hkp://keys.gnupg.net

My public key with signature 1024D/E12C5A4C is on the server
hkp://keys.gnupg.net

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




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