>
> This is a something I was hoping for clarification on:  If I create an
> object dynamically and add it to the DOM via create on a parent.  If I
> later free that object manually and replace it with a newly created
> version (still set to dynamic), does that cause any memory leaks?
>

If you free the memory Ada's runtime will finalize the object which will
remove any references to it in the Gnoga cache on the browser side. If you
leaving "dangling pointer" on the Ada side you will of course have a leak.
(Unless of course they were marked dynamic before creation and so the
parent Gnoga view has a reference and will deallocate it when it finalizes)


> Does the DOM remember every object I add to a parent or will freeing
> it remove it completely from the DOM?
>

On the browser side elements created by the Gnoga framework have a
reference in a global cache called gnoga[]. When the Gnoga object on the
Ada side is finalized, the reference in the cache is removed. As long as
that element is not in the DOM the browser will release the object's memory
as part of its garbage collection on the browser side.


>  Would something like this cause
> any problems (memory leak or otherwise)?
>

If you are using dynamic you shouldn't be deallocating manually. If you do
then when the garbage collection starts with App.Console is finalized it
will try to deallocate already deallocated blocks of memory.

Unless you have extreme memory constraints, just overwrite the pointer
since the parent view will take care of things or do not use dynamic and
deallocate on connection close.

David Botton
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list

Reply via email to