Closed GoogleCodeExporter closed 8 years ago
The simplest solution is to add reference-counting to your external classes,
this should also work with shared resources/object.
You can either just add a "RefCount" field to your classes, or wrap them in a
very simple class that would take care of releasing them (feel free to use
dwsUtils's TRefCountedObject for that).
A variantof refcounting based on your above snippet is to to allow the same
object to be added multiple times in your FScriptObjInstances (using a list
rather than a dictionnary), and only perform the "ExternalObject.Free" when it
is no longer present (ie. no longer referenced by any script)
Original comment by zar...@gmail.com
on 4 Sep 2012 at 9:10
Thanks a lot, I thought about extend my classes, but not wrap them in a
RefCountedObject
And indeed, it should also solve my problem of releasing cached resources.
I will try that.
Thx again.
Original comment by tetra...@gmail.com
on 4 Sep 2012 at 10:18
Original issue reported on code.google.com by
tetra...@gmail.com
on 4 Sep 2012 at 8:31