网页浏览器?如何释放内存? "Release()"不工作!谁能帮我 ? [英] webbrowser? how to Release the memory? "Release()" don't work! who can help me ?

查看:132
本文介绍了网页浏览器?如何释放内存? "Release()"不工作!谁能帮我 ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

我使用webbrowser多次加载html,然后发现销毁Windows时内存不会减少.

我的英语不好,请原谅我!

如果您能理解,请帮助我.

我问很多人,他们认为这是Microsoft的错误,我认为不是.

也许,我找不到正确的方法.


我的程序在window7和IE8上运行.

im_axwindow_ui是CAxWindow类.

我的密码:

hi everyone.

i use webbrowser to load a html many times,than i find that when i Destroy my windows,the memory do not decrease.

My English is bad, please forgive me!

if you can understand, please help me.

i ask many people,they think this is a bug of the Microsoft,i do not think so.

maybe, i do not find a right way.


my program run on window7 and IE8.

im_axwindow_ui is a CAxWindow class.

my Key code:

im_axwindow_  ui m_scroll_ui;

CRect _rc;
GetClientRect(&_rc);

m_scroll_ui.Create(m_hWnd, CRect(0,27,_rc.right,_rc.bottom),NULL,WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VSCROLL,NULL);

// IDC_HISTORY_HTML  is my file end with .html,the html have some javascript code
// will load some Picture.
m_scroll_ui.CreateControl(IDC_HISTORY_HTML);
//here,my program possess the memory about 300M

m_scroll_ui->QueryControl(&m_pWeb2);
DispEventAdvise(m_pWeb2);
m_pWeb2->put_Silent(VARIANT_TRUE); 
pHost = new CImpIDocHostUI(this); 
pHost->changeStyle(_style);
pHost->AddRef();   
SetExternalUIHandler(pHost); 
DispEventUnadvise ( m_pWeb2 );

//when i destroy my window,i will release iwebbrowser2指针
//the memory do not decrease.
m_pWeb2.Release();

推荐答案

::CoFreeUnusedLibraries();



希望这会有所帮助,
巴勃罗.



Hope this helps,
Pablo.


这篇关于网页浏览器?如何释放内存? "Release()"不工作!谁能帮我 ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆