I've read on
http://blogs.msdn.com/jscript/archive/2008/03/05/jscript-in-internet-explorer-8-beta-1-for-developers.aspx
that IDispatchEx was extended to support garbage collection when objects
inside the JScript engine cross-reference objects outside of the JScript
engine.
I could use this feature in my own application that embeds the JScript
engine.
I would be happy if you could obtain some information about these
extension(s) to IDispatchEx.
Thanks.
Regards,
Marvin Landman
Thanks for the posting.
I'm researching this issue and will update you soon.
Regards,
Jialiang Ge
Microsoft Online Community Support
=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
There were no extensions to the IDispatchEx that were shipped publically in
IE8. However, in IE8, the Jscript garbage collector was extended to track
COM clients (tied to IE). This makes tracked COM clients to simultaneously
live in both the ref-counted (IE) and garbage collected (JScript) worlds
thereby avoiding the leaks due to uncontrolled ref-counts.
I do not find MSDN article that covers this topic. However, if you can let
me know the purpose for which you are looking for this information, I might
be able to provide more details.
Thank you for your reply.
I basically want to avoid the same reference counting and memory leaking
problem that is described in these articles:
http://blogs.msdn.com/jscript/archive/2008/03/05/jscript-in-internet-explorer-8-beta-1-for-developers.aspx
http://blogs.msdn.com/jscript/archive/2007/05/01/legacy-ie-jscript-circular-memory-leak-problem.aspx
The only difference is that I am using my own host application that
enables scripting and provides an object model of its own.
If the solution implemented for IE and JScript will avoid this circular
reference problem for my application as well then I'm fine, but I
believe that avoiding this circular reference is only possible by
implementing it in both the script engine (JScript) and the host (IE or
my application).
If avoiding this problem requires me to implement some extra interfaces
or do something please let me know.
If avoiding this problem is not possible in my own application (just IE)
then I would like to ask you to sumbit a feature request to the
appropriate team of yours.
Thanks.
Marvin
I get this information from the product team:
This enhancement is closely tied and intrinsic to IE, and cannot be used by
other hosts.
Please feel free to tell me if there's anything else I can do for you in
this thread.
I am unhappy with this and the only interface (COM based) provided by
the JScript engine is unable to solve the circular reference problem, so
I'll run some tests and if I find out that this is a serious problem for
my application, I will have to use another engine like TraceMonkey or V8
that have a different API that enables avoiding memory leaks resulting
from un-GC-able circular references.
I would appreciate if you could submit a feature request at the team
regarding this problem.
Thanks.
Marvin
Than you for the articles, they are very useful if you are writing a
script for an existing host that has problem with circular references.
On the other hand I am working on a host application and this problem is
clearly a design flaw in the host application. When Microsoft designed
IE and JScript they most likely didn't reallize this problem and it's
quite difficult to solve the problem using COM reference counting
because you have to use a second reference counting mechanism in
addition to the COM method.
The articles you referenced merely describe a workaround to this design
flaw. If you are the designer of a host application however, you have
the power to avoid the problem altogether.
Marvin
I understand the frustration. I will submit the request to the IE team. You
are also welcome to add your supplements to
https://connect.microsoft.com/IE and
http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/threads/. I
also suggest advising the users of your host app to be careful of circular
reference if the problem cannot be completely solved at present.