Gtk memory management... [How often do you see this...?]



I have finally, after about an hour and a half, figured out
how the gtk memory management system works by trolling the
message archives on this list.

This topic must come up really frequently; new gtk programmers
trying to destroy objects that have been destroyed when the 
parent was destroyed, or trying to understand how the gtk 
memory system works.

Why is there no mention of the topic anywhere useful? Like in
a section of the gtk tutorial. Surely that would be a logical
place to explain some kind of basic concepts for memory 
management... 

Even the "Hello World" example just glosses over the issue of 
freeing resources by bailing out of main() and letting the OS
handle it.

And since I'm here, I may as well ask (because I'm still
uncertain about this) when the gtk_main loop exits for the
final time (outer loop), are all resources released? If not,
at what point should you release them (and how, if you haven't
kept any pointers to objects to release)?

What if you're using gtk_main_iteration_do()? That function
seems to always return TRUE (and according to the api ref'
"Returns :TRUE if gtk_main_quit() has been called for the 
innermost mainloop."), but no resources seem to be free'd
or anything. 

cheers,
Doug.




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