(1) sounds good to me, but how do we do it? I didn't think there was an
easy way to tell if there was a reference to a class instance. �Mind you,
I'm happy to be wrong. :-)
Glenn McAllister
TID - Software Developer - VisualAge for Java
IBM Toronto Lab, (416) 448-3805
"An approximate answer to the right question is better than the
right answer to the wrong question." - John W. Tukey
Please respond to [EMAIL PROTECTED]
To: � � � [EMAIL PROTECTED]
cc:
Subject: � � � �Re: [PATCH] Less memory consumption for subbuilds
>>>>> "gm" == glennm �<[EMAIL PROTECTED]> writes:
�gm> Also, the execute method now has a try/finally block to ensure
gm> the subproject p1 is set to null so it can be GC'ed (thanks for
gm> pointing that out Conor).
This approach has a serious problem. It relies on the fact that a
particular instance of a task will be executed once and only once -
this might not be true.
If you've given an id to the task, this one can be referenced via
Project.getReferences() and nothing is stopping another task - be it a
script task or one written in Java - to invoke execute on it again.
What can we do about this?
(1) Check whether there is a reference to this instance (or the
surrounding target) and only null p1 if there isn't?
(2) Put a disclaimer into the docs saying "Ant tasks may only be
executed once"?
(3) Don't drop the reference to p1?
I'd prefer (1).
Stefan