I'm working on a plugin
In the plugin I have defined a class (class1) and one of the methods
returns another class (class2) which is in the plugin.
The Class1 instance may have 1 or more Class2 instances (depending on a
bunch of things at runtime)
When I do
dim class1Var as Class1
dim class2Var as Class2
dim i as integer
class1Var = new Class1
for i = 1 to Class1.Count
class2Var = class1.Value(i)
next
what I'm seeing is that class1Var's is properly constructing the class2
instance to be returned.
BUT, class2Vars destructor is not being called IF there already is an
instance.
So the darn loop leaks.
But if I do
dim class1Var as Class1
dim class2Var as Class2
dim i as integer
class1Var = new Class1
for i = 1 to Class1.Count
class2Var = class1.Value(i)
class2Var = nil
next
this does not leak because the instance's destructor gets called.
Does that make sense ?
How do I fix this kind of issue ?
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|