mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
wpe: Reintroduce persistent WebContext
A WebContext leak was introduced in MR https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2252. If we wanted one WebContext per WebView we should also unref the WebKitWebContext when destroying the WebView. This patch reintroduces the persistent WebContext, initially part of https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1484. Fixes #1084 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1982>
This commit is contained in:
parent
618bbf80dc
commit
a31307d37d
1 changed files with 7 additions and 5 deletions
|
@ -346,11 +346,13 @@ WPEView* WPEContextThread::createWPEView(GstWpeVideoSrc* src, GstGLContext* cont
|
|||
|
||||
WPEView* view = nullptr;
|
||||
dispatch([&]() mutable {
|
||||
auto* manager = webkit_website_data_manager_new_ephemeral();
|
||||
auto web_context = webkit_web_context_new_with_website_data_manager(manager);
|
||||
g_object_unref(manager);
|
||||
|
||||
view = new WPEView(web_context, src, context, display, width, height);
|
||||
if (!glib.web_context) {
|
||||
auto *manager = webkit_website_data_manager_new_ephemeral();
|
||||
glib.web_context =
|
||||
webkit_web_context_new_with_website_data_manager(manager);
|
||||
g_object_unref(manager);
|
||||
}
|
||||
view = new WPEView(glib.web_context, src, context, display, width, height);
|
||||
});
|
||||
|
||||
if (view && view->hasUri()) {
|
||||
|
|
Loading…
Reference in a new issue