Click here to Skip to main content
15,904,653 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C++
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();
Posted
Updated 13-Mar-12 3:15am
v4
Comments
Maximilien 13-Mar-12 9:08am    
too much code, please try to edit to post only significative code
lin98666521 13-Mar-12 9:17am    
thank you for your replication i Improve question,i hope you can help me.
[no name] 13-Mar-12 10:03am    
How are you checking available memory?
lin98666521 13-Mar-12 10:09am    
i checking available memory by taskhost.
i destroy my window,Half an hour later the memory do not change.
E.F. Nijboer 13-Mar-12 10:51am    
It would be better to check it out using the debugger because the memory manager implementation might simply not release it due to some threshold for example. What happens if you re-open the window in your application? If no extra memory is allocated, it might indicate this situation.

1 solution

C++
::CoFreeUnusedLibraries();


Hope this helps,
Pablo.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900