Re: Libglade resource consuming question.



On 8/9/07, Carlos Savoretti <csavoretti clubsanjorge com ar> wrote:
Hi all!


Several objects within a program has a Xml buffer taken from
xmlDocDumpFormatMemory (), one for each of them. Only one of
those objects will be displayed at a time.

Question is:
Is it saved a "lot a memory" if I just keep the xml buffer and
use glade_xml_new_from_buffer () when the object would must to
be shown; or (easier from the programming point of view) rightly
use glade keeping a lot of "glade" built trees possibly not used
any more but now the xml buffer can be freed.

Do I be clear ? (When doubt appears it's probably not...)
Shortly: GladeXml objects with a moderate amount of widgets are
very resource consuming ? or not compared against
xmlDocDumpFormatMemory () result ?

Thanks a lot.


Carlos Savoretti.

I'm not sure if it's exactly what you're asking, but I asked a
question on this list about keeping the GladeXML object and calling
glade_xml_get_widget each time I need a widget. In general, that seems
like a bad idea, just call glade_xml_get_widget once for each widget
you need, store the pointers, and unref the GladeXML. So in your case,
I think you'd free the data returned by xmlDocDumpFormatMemory as
well, so the only things actually in memory are the widgets
themselves. Rather than destroying them when they're not needed, just
hide them, and show again when needed.

-Jim



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