How to destroy a WebContents object?

53 views
Skip to first unread message

joker

unread,
Oct 31, 2013, 1:28:13 AM10/31/13
to chromi...@chromium.org
I use the "content::WebContents::Create(profile_)" create a WebContents object and load an url by "webcontent_->GetController().LoadURL("http://example.com"...)"
When I want to destroy the object, I delete the pointer directly. But I found about 1MB memory leak. Should I do something else to destroy the object?

Avi Drissman

unread,
Oct 31, 2013, 1:32:11 AM10/31/13
to sslik...@gmail.com, Chromium-dev
Deleting the WebContents by deleting the pointer should work. Do you have details about what leaked?


On Thu, Oct 31, 2013 at 1:28 AM, joker <sslik...@gmail.com> wrote:
I use the "content::WebContents::Create(profile_)" create a WebContents object and load an url by "webcontent_->GetController().LoadURL("http://example.com"...)"
When I want to destroy the object, I delete the pointer directly. But I found about 1MB memory leak. Should I do something else to destroy the object?

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev

joker

unread,
Oct 31, 2013, 5:22:17 AM10/31/13
to chromi...@chromium.org, sslik...@gmail.com
I've no idea about what leaked.
It's a WebUI page, and the URLDataSource may cause this.
I don't need to destroy the WebUI object manually, right?
在 2013年10月31日星期四UTC+8下午1时32分11秒,Avi Drissman写道:

Avi Drissman

unread,
Oct 31, 2013, 10:18:12 AM10/31/13
to sslik...@gmail.com, Chromium-dev
I don't know what the ownership semantics of WebUI are. Sorry.
Reply all
Reply to author
Forward
0 new messages