PDA

View Full Version : How to clear memory in QWebView , when call evaluateJavaScript()?



tiaoweiliao
11th April 2016, 04:45
sorry,my English sucks , My first time to use qtcentre.

I'm using Qt 5.3.1. windows 7 64bit.

I had a web page to load , I need to be repeated calls evaluateJavaScript() , insert content to Web page.

js function code is:
function addMsg(){
var sHtml='';
sHtml += '<div><p>hello,world</p></div>'
$('body').append(sHtml);
}

I through the timer calls evaluateJavaScript("addMsg()") , I found in memory increasing.

How do I free the memory?

anda_skoa
11th April 2016, 09:48
You are appending to the HTML document, so the memory requirements to hold that document increase.

Cheers,
_

tiaoweiliao
12th April 2016, 08:13
thx.
I see. :)