I recently ran into a bug (39311) with the XML classes where if the xml.load(s) fails for some reason the xmlException object never get released… for example do this:
dim s as string
s = “” // or any invalid xml string
dim x as new xmlDocument
try
x.load(s)
catch e as XmlException
// do something
end try
Each time you run this code the Runtime.ObjectCount increases by 1… even after x is destroyed… If you look at the globals-runtime-contents, you will see all the unreleased objects.
So my question: Is there anyway to release these objects? I looked at introspection but that does not seem to help.
I recall that the plugin SDK offers retain/release functions for Xojo objects. So, if you can get to those SDK functions somehow, e.g. if someone made a plugin for that (may MBS already does), then you can release the object. There may be other ways to get to these internal functions as well. If you’re building for OSX, for instance, you might be able to use a declare against the framework or runtime dylib and get to the function if you know its name.
The best solution I have is to make sure the string is actually valid encoding represented in the declaration at the top of the file… make sure the number of “<” and “>” are the same… but doing that is going to slow things down…