Todd Price
Posts: 14
Joined: 2014-08-13
|
We're having memory issues show up after the first or second time our toolbar module code is executed, and I'm looking at possibly releasing the IE application after our code succeeds. This code successfully releases IE:
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(this.IEObj); |
System.Runtime.InteropServices.Marshal.FinalReleaseComObject(this.IEObj);
Is it possible to manually recreate this reference? |
|
Andrei Smolin
Add-in Express team
Posts: 19113
Joined: 2006-05-11
|
Hello Todd,
Releasing that object is incorrect since Add-in Express relies on it. There's no way to recreate it.
Andrei Smolin
Add-in Express Team Leader |
|
Todd Price
Posts: 14
Joined: 2014-08-13
|
Is there a way to instead "reboot" add-in-express, or force reload my module entirely? |
|
Andrei Smolin
Add-in Express team
Posts: 19113
Joined: 2006-05-11
|
Hello Todd,
It's impossible. I think you are on a wrong track. Could you please describe the issue you are having?
Andrei Smolin
Add-in Express Team Leader |
|
Todd Price
Posts: 14
Joined: 2014-08-13
|
Our add-in takes screen captures of web pages and stores the underlying HTML source and DOM as well. The issue is that after a few captures, retrieving the DOM like this:
currentSnapshot.Dom = this.HTMLDocument.documentElement.outerHTML; |
currentSnapshot.Dom = this.HTMLDocument.documentElement.outerHTML;
...throws an exception related to memory. It works fine the first time, every time. But eventually, the process (user navigates, initiates page capture, code scrolls, code takes screen shots, code accesses DOM) throws an exception on this line above. I've tried late-binding as well:
object doc = this.HTMLDocument.documentElement; | var html = doc.GetType().InvokeMember("outerHTML", BindingFlags.GetProperty, null, doc, new object[] { }); |
object doc = this.HTMLDocument.documentElement;
var html = doc.GetType().InvokeMember("outerHTML", BindingFlags.GetProperty, null, doc, new object[] { });
...but this fails the same way.
Thoughts on how to alleviate this? |
|
Andrei Smolin
Add-in Express team
Posts: 19113
Joined: 2006-05-11
|
Hello Todd,
Does this occur on a certain web site only? if so, the pages may have a problem in their HTML. Also, this may be caused by your code. Could you try to refresh the browser after your add-on "takes screen captures of web pages and stores the underlying HTML source and DOM as well"?
Andrei Smolin
Add-in Express Team Leader |
|
Andrei Smolin
Add-in Express team
Posts: 19113
Joined: 2006-05-11
|
I should have said: "call IEApp.Refresh()", not "refresh the browser".
Andrei Smolin
Add-in Express Team Leader |
|