【文件属性】:
文件名称:delphi动态 WebBrowser 释放问题.txt
文件大小:646B
文件格式:TXT
更新时间:2018-03-05 01:49:51
delphi动态 WebBrowser
delphi动态 WebBrowser 释放问题.txt
var
web:TwebBrowser;
procedure TForm1.Button1Click(Sender: TObject);
begin
web:=TWebBrowser.Create(Self);
web.ParentWindow:=Self.Handle;
web.SetBounds(100,100,100,100);
web.OnDocumentComplete:=WebBrowser1DocumentComplete;
web.Navigate('http://www.3yeah.com/');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
// web.Destroy;
web.Free ;
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
if(web.LocationURL='http://www.qq.com/') then
begin
// web.OnDocumentComplete:=nil;
web.Free;
end;
end;
网友评论
- 不是我要的,还是释放不了内存