ActiveX IDispatchWrappingDynamicObject crashes IE


#1

I used the ActiveX wrapper code without issues a few months back but I am pretty sure I just stuck to basic data types. I’m now trying to use it with DynamicObject types passed as return values and I’m getting segfaults galore in the windows OLE DLL.

Is there a chance that the refCnt of IDispatchWrappingDynamicObject should be initialised to 1 and not 0? Increasing it in code seems to fix all my issues but I haven’t analysed memory use yet to see if its now leaking.

Has anyone else had similar issues with IE browser plugins?


#2

That’s interesting… I’ve been using those objects myself without any problems, but I it does look like you might be right about the ref count… I’d be interested to know if you have any problems with leaks when you set it to 1 - there are some debug messages that dump out the current number of allocated IDispatchWrappingDynamicObjects, which should make it easy to see if any are escaping.


#3

They seem to be getting cleaned up just fine. In my case the IDispatch debug statements increment up to about 60 and then decrement back to zero. I ran my page in a javascript refresh loop overnight last night. With about 10 seconds between refreshes for about 6 hours. Thats about 2000 page refreshes or so and it was running just fine this morning. I haven’t done any analysis of allocators and such but it looks sweet to me!

BTW, For comparisons sake, I’m running Vista 32-bit with IE8.0.6001.18904.


#4

Ok, that sounds good. I’m a bit confused about why I’d never have seen this kind of problem myself - maybe in my case the javascript has just been hanging on to these objects longer than the c++ needed them… Thanks for the info!