在一个CDHtmlDialog的某个函数中,IHTMLElement *pElement;
GetElement(_T("img1"),1,&pElement);GetElement(_T("img2"),1,&pElement);...
这样使用N次以后,
中间或使用完后用不用把pElement->Release();掉?
如果不Release掉会不会有内存泄漏?
使用CDHtmlDialog的html事件响应函数中的参数pElement的时候呢?
GetElement(_T("img1"),1,&pElement);GetElement(_T("img2"),1,&pElement);...
这样使用N次以后,
中间或使用完后用不用把pElement->Release();掉?
如果不Release掉会不会有内存泄漏?
使用CDHtmlDialog的html事件响应函数中的参数pElement的时候呢?
那函数参数中的pElement呢?
用完以后要不要Release呢
这样才可以不理会内存分配和释放么?
IHTMLElement *pElement; 这个还是要自己手工去调用Release的,不然就无法保证引用计数正确减一,有可能会引发内存泄露。