[Gambas-user] XMLReader: strange message

Benoit Minisini gambas at ...1...
Thu Dec 2 12:20:48 CET 2004


On Wednesday 01 December 2004 12:20, Toni Schornboeck wrote:
> Hello.
>
> I don't know wether it is a bug or a mistake by me.
>
> I get the following message in the "direktfenster"(I'm using the german
> version) (word by word translation: "direct window")
>
> WARNING: circular references detected
> RootElement (1)
> TextElement (5)
> BlockElement (2)
> EmptyElement (10)
> WARNING: 74 allocation(s) non freed.
>
> RootElement, TextElement, BlockElement and EmptyElement are classes.
> And the number is the amount of objects a created for each class.
>
> The code parses a XML file and does some evaluation (some kind of very
> trivial XSLT).
>
> The circular references are there, because every Element yields a reference
> to his parent.
> I can't avoid this reference to parent and I see no reason to do so.
>
> What can I do about it? Obviously gambas does not free all elements, or
> does it even though this message? Is there something like a weak-reference
> or stuff like that to tell gambas that the reference to parent is just a
> pointer which doesn't own the pointee?

Alas no, a reference is a reference, and prevent the object to be freed.

A solution to put null in all these back parent references when the program 
ends.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...




More information about the User mailing list