[GTK] Memory leak in webkit_web_view_init

https://bugs.webkit.org/show_bug.cgi?id=87943

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-05-31
Reviewed by Martin Robinson.

Fixed a memory leak in webkit_web_view_init by making the
UserMediaClientGtk to be owned by the WebView.

* webkit/webkitwebview.cpp:
(webkit_web_view_init):
* webkit/webkitwebviewprivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8de6a8a5
2012-05-31 Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com>
[GTK] Memory leak in webkit_web_view_init
https://bugs.webkit.org/show_bug.cgi?id=87943
Reviewed by Martin Robinson.
Fixed a memory leak in webkit_web_view_init by making the
UserMediaClientGtk to be owned by the WebView.
* webkit/webkitwebview.cpp:
(webkit_web_view_init):
* webkit/webkitwebviewprivate.h:
2012-05-31 commit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Spell checker doesn't recognize contractions (apostrophes)
......
......@@ -119,10 +119,6 @@
#include "DeviceOrientationClientGtk.h"
#endif
#if ENABLE(MEDIA_STREAM)
#include "UserMediaClientGtk.h"
#endif
/**
* SECTION:webkitwebview
* @short_description: The central class of the WebKitGTK+ API
......@@ -3555,7 +3551,8 @@ static void webkit_web_view_init(WebKitWebView* webView)
#endif
#if ENABLE(MEDIA_STREAM)
WebCore::provideUserMediaTo(priv->corePage, new UserMediaClientGtk);
priv->userMediaClient = adoptPtr(new UserMediaClientGtk);
WebCore::provideUserMediaTo(priv->corePage, priv->userMediaClient.get());
#endif
if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
......
......@@ -34,6 +34,10 @@
#include <webkit/webkitwebview.h>
#include <wtf/gobject/GOwnPtr.h>
#if ENABLE(MEDIA_STREAM)
#include "UserMediaClientGtk.h"
#endif
namespace WebKit {
WebCore::Page* core(WebKitWebView*);
WebKitWebView* kit(WebCore::Page*);
......@@ -104,6 +108,10 @@ struct _WebKitWebViewPrivate {
#if ENABLE(ICONDATABASE)
gulong iconLoadedHandler;
#endif
#if ENABLE(MEDIA_STREAM)
OwnPtr<WebKit::UserMediaClientGtk> userMediaClient;
#endif
};
void webkit_web_view_notify_ready(WebKitWebView*);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment