Memory Leak From WebBrowser BSTR
I am experiencing a leak of some sort using webbrowser object; I am still
surfing all over the place for answers -- I've seen some similar questions
on this forum as well, but I cant see how to apply those findings in my
case.
After a page loads the DocumentCompleted action fires and I parse the HTML
on the page,
void PageScrollTimerTick(object sender, EventArgs e)
{
String pageSrc = webBrowser1.Document.Body.InnerHtml;
// Check if we need to stop scrolling..
if (m_iLastFramePageLength == pageSrc.Length)
{
m_iLastFramePageLength = 0;
m_scrollTimer.Tick -= PageScrollTimerTick
m_scrollTimer.Enabled = false;
parsePage();
nextPage();
}
else
{
m_iLastFramePageLength = pageSrc.Length;
webBrowser1.Document.Window.ScrollTo(0,
webBrowser1.Document.Body.ScrollRectangle.Height);
}
}
The Leak: As I type this, I wonder why these functions? I have 6
different functions that do very similar tasks. I think these because they
are executed from a TIMER which probably uses a different thread. I'm I
close? How can I resolve this. Perhaps Invoke() on the web browser
control?
No comments:
Post a Comment